Windows installation tortoisegit detailed use tutorial

Source: Internet
Author: User

Installation Preparation:

    1. First you have to install Git msysgit1.9.5 under Windows

    2. Install the version controller client Tortoisegit tortoisegit1.8.12.0 [32 and 64 do not download the wrong, not accustomed to English friends, can also be the next language pack]

First, installation diagram:

    1. Install git first "all the way to the default"

After installing Git, right-click on the menu to find a few more options about Git

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

After the installation, right-click, you will find a few more options on the Tortoisegit menu

By this, the installation is completed, compared to TORTOISESVN, installed tortoisegit do not need to restart the computer.

The next step is to use Tortoisegit

Ii. Illustrations using Tortoisegit

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

Create a repository, commit (commit) files, push (push) files, update files, create branches.

Introduction: Git is a distributed version of the controller, in fact, everyone's computer is a complete repository, such as two people write a project in the LAN, then these two people's computer is a complete project, when the new code appears, push directly to each other. Of course, when many people, and not in the LAN, it is not possible to push to everyone, Git's solution is to use a computer as a centralized repository, we put the new code to the top, we want to pull to their own computer. More famous abroad is the GitHub, the domestic Oschina is also widely known.

    1. Create a version library

      Create a folder Gitdemo, then right---git create repository here ...

      Do not tick the make is Bare here

After determining, in the Gitdemo folder next to one more. Git folder "PC 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 Choosing Git commit-> "Master"

2.2 Fill in the message, tick the file you want to commit, then click 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, and refer to steps 2.1 and 2.2.

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: Create a new project on Oschina, enter Oschina-->[email protected]> new project

Click Create Item, the red box is the URL of the project

6.2 Push the computer code to the cloud.

Right-click-->tortoisegit-->push

Set the 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.

After 6.3 success, let's go to Oschina to see the push project.

7.git also has a very useful function, branch.

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 during the modification process, in addition to new add code and files in, 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 branch, such as the name Newfunction, and then add the new function in the branch, if OK, merge the code into the Master branch, if the new function fails, switch back to the master branch, The code written in Newfunction is completely invisible.

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

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

Right-click and you will find the current branch of your new Newfunction branch.

7.2 Next, just be happy to add your function, we proprame.txt not only added the Show method, but also modified 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 to the master branch.

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

Then we switch to the master branch and right-click-->tortoisegit-->switch/checkout

Select Master, and then determine

And see if the code in program is 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?

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.