Windows installation tortoisegit detailed use tutorial

Source: Internet
Author: User

Tags: tortoisegit

Environment: win8.1 64bit

Installation Preparation:

    1. first you have to install Windows under the git? msysgit1.9.5
    2. Installing the version Controller client tortoisegit? tortoisegit1.8.12.0? [ and the - Do not download the wrong, not accustomed to English friends, can also be the next language pack ]

First, installation diagram:

    1. Install first GIT " The only way to go"

Install well git later, right-click, you will find a few more items on the menu GIT the Options

2. Install tortoisegit"All the way to the default"

after the installation, right-click, you will find a few more items on the menu Tortoisegit the Options

by this, the installation was completed, compared to TortoiseSVN , the installation is complete Tortoisegit no need to restart your computer.

the next step is to use Tortoisegit

second, the use of illustrations Tortoisegit

Here is just a demonstration of some of the most basic features:

Create a repository, submit (Commit) files, pushing (push) files, updating files, creating branches.

introduction: git is a distributed version of the controller, in fact, everyone's computer is a complete version of the library, such as two people write a project on the LAN, then these two people's computer is a complete project, When new code appears, the direct push push to everyone, git The solution is to use a computer as a centralized repository, and the new code is all push go up, get in the pull to your own computer. More famous abroad is the github domestic oschina The

    1. Create a version library
      Create a folder Gitdemo, and then ? Right-click --git Create repository here ...

      ??

      Do not tick here Make is Bare

after determining, the Gitdemo folder next to one more . Git folder "Computer to be set to show hidden folders"

This folder, try not to randomly modify or delete.

2. Create a file and commit (commit) to the repository [ This operation can be done in an offline state ]

2.1 Select Git commit-> "Master"

2.2 Fill in message , tick to Commit file, and then tap OK . A pop-up window will click close .

3. then Add a new method to the program. When the file code changes, then the file is displayed as a red exclamation point

4. Submit the new code to the repository, referring to 2.1 and 2.2 steps.

5. View Logs

In the log, the information about the file changes is clear.

6. Push the code to the cloud, for example:GitHub,oschina

?? 6.1: in the Oschina Create a new project on , Enter oschina-->[email protected]> New Project

Click Create Project, the red box is the project's URL the

6.2 Get the computer code Push to the cloud.

Right-click -->tortoisegit-->push

set it up. URL , OK. Then start the push, enter the user name, enter the password and OK

Enter the user name, enter the password later, and then wait for the success.

6.3 after success, we go to Oschina Take a look. Push of the project bar

7.git There is also a very useful function, branching.

Find the problem: You write a lot of code, run OK but suddenly want to add a new function, this feature you do not know whether it can run normally, and in addition to new code and file in the process, but also modify the previous code. In case of failure, the change back is a very troublesome thing. This is a time when a lot of people use backup methods. take a look at how git gracefully handles the problem.

git processing: When you want to add a new function, you can create a new branch, such as a name called newfunction , and then add the new feature to the branch, if OK , merge the code into Master Branch, if the new feature fails, switch back to Master branch up, in newfunction write the code, and all can not see.

[Ps:master is the main branch of the new project ]

7.1 Create a new branch, right-click -->tortoisegit-->create Branch

???

Right-click and you will find the current branch for your new newfunction Branching out

7.2 Next, be happy with new additions to your features; Proprame.txt not only increases the Show method, and also modifies the Metho Method

7.3 submit our code, at this time we found that this new feature does not, there are many loopholes and so on. We want to go back to the previous code. What do we do?

7.4 in order to return to the previous project, we directly cut back Master Branch.

First look at the current file content, new additions and modifications are in.

then we switch to Master Branch, right-click -->tortoisegit-->switch/checkout

Select Master , and then determine

Look at it again . Program is the code back in the past?

Whether you modify it or add it, it doesn't affect resiliency. This is what the branch does. Does this feature help you save a lot of work?

??

from <http://www.mamicode.com/info-detail-423481.html>

??

Windows installation tortoisegit detailed use tutorial

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.