Windows installation tortoisegit detailed usage Tutorial "basics"

Source: Internet
Author: User

Environment: win8.1 64bit

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:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A2/wKioL1S2cGWDgtw7AAAzV1JtLz4385.jpg "title=" 1.png " alt= "Wkiol1s2cgwdgtw7aaazv1jtlz4385.jpg"/>

    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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A5/wKiom1S2caHx4weEAAEH0iQdstE374.jpg "title=" 1.8. PNG "alt=" wkiom1s2cahx4weeaaeh0iqdste374.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A5/wKiom1S2dyOg2eTzAAEqf6QkmoY252.jpg "title=" 2.png " alt= "Wkiom1s2dyog2etzaaeqf6qkmoy252.jpg"/>

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

      650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/58/A2/wKioL1S2fNPRoYPhAAEePBn7-gA930.jpg "title=" 2.1. PNG "alt=" wkiol1s2fnproyphaaeepbn7-ga930.jpg "/>


      650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A5/wKiom1S2fOWy-rywAADGJqlins8081.jpg "style=" float: none; "title=" 2.2.png "alt=" Wkiom1s2fowy-rywaadgjqlins8081.jpg "/>

      Do not tick the make is Bare here

      650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A2/wKioL1S2fbHz9Ry7AABS-_Bho2M886.jpg "style=" float: none; "title=" 2.3.png "alt=" Wkiol1s2fbhz9ry7aabs-_bho2m886.jpg "/>

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]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A2/wKioL1S2geSRWeEWAACAZDlmXzw696.jpg "title=" 3.png " alt= "Wkiol1s2gesrweewaacazdlmxzw696.jpg"/>

2.1 Choosing Git commit-> "Master"

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/58/A2/wKioL1S2gnfB9Wq_AADu--urKHw095.jpg "title=" 3.1. PNG "alt=" wkiol1s2gnfb9wq_aadu--urkhw095.jpg "/>

2.2 Fill in the message, tick the file you want to commit, then click OK. A pop-up window will click Close.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/58/A2/wKioL1S2gtrQzKatAAIGrB0nv8w918.jpg "title=" 3.2. PNG "alt=" wkiol1s2gtrqzkataaigrb0nv8w918.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A2/wKioL1S2g5aRaP6GAADVFkMb_6M134.jpg "title=" 2.4. PNG "alt=" wkiol1s2g5arap6gaadvfkmb_6m134.jpg "/>

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

5. View Logs

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A5/wKiom1S2hCbx0ucYAAJRb8cNTlM825.jpg "title=" 4.png " alt= "Wkiom1s2hcbx0ucyaajrb8cntlm825.jpg"/>

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

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/58/A5/wKiom1S2hHLhOlA7AAJiRVFH9fY252.jpg "title=" 4.1. PNG "alt=" wkiom1s2hhlhola7aajirvfh9fy252.jpg "/>

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

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/58/A2/wKioL1S2hligPtqIAAGekalEh3o374.jpg "title=" 4.2. PNG "alt=" wkiol1s2hligptqiaagekaleh3o374.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A2/wKioL1S2h27hXZlDAADMIxMjQPs030.jpg "title=" 6.1. PNG "alt=" wkiol1s2h27hxzldaadmixmjqps030.jpg "/>

6.2 Push the computer code to the cloud.

Right-click-->tortoisegit-->push

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A5/wKiom1S2iE2TKsACAAH33MtS4vo136.jpg "title=" 6.2. PNG "alt=" wkiom1s2ie2tksacaah33mts4vo136.jpg "/>

Set the URL, OK. Then start the push, enter the user name, enter the password and OK

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A2/wKioL1S2iUHzLNcQAAME87a87ME496.jpg "title=" 6.2.1. PNG "alt=" wkiol1s2iuhzlncqaame87a87me496.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A5/wKiom1S2iLvDMZh5AAEP4gIvaL4995.jpg "title=" 6.2.2. PNG "alt=" wkiom1s2ilvdmzh5aaep4gival4995.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A2/wKioL1S2igmATaqRAAHJqxGZciM938.jpg "title=" 6.3. PNG "alt=" wkiol1s2igmataqraahjqxgzcim938.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A2/wKioL1S2jeWjAmwPAAE2UQMZ6i4217.jpg "title=" 7.11. PNG "alt=" wkiol1s2jewjamwpaae2uqmz6i4217.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A6/wKiom1S2jXjCcTaPAAD1j9rKeKM309.jpg "title=" 7.2. PNG "alt=" wkiom1s2jxjcctapaad1j9rkekm309.jpg "/>

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

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A2/wKioL1S2jmyj9-dnAAEU2pHaKUk307.jpg "title=" 7.1. PNG "alt=" wkiol1s2jmyj9-dnaaeu2phakuk307.jpg "/>

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?

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A3/wKioL1S2j5GSSoE4AAIdIWi_tV8665.jpg "title=" 7.4. PNG "alt=" wkiol1s2j5gssoe4aaidiwi_tv8665.jpg "/>

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.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/58/A6/wKiom1S2j--CQedUAAD3tf5SDWk378.jpg "title=" 7.5. PNG "alt=" wkiom1s2j--cqeduaad3tf5sdwk378.jpg "/>

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

Select Master, and then determine

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A6/wKiom1S2kIWR_elPAAEO8ggIGnY473.jpg "title=" 7.6. PNG "alt=" wkiom1s2kiwr_elpaaeo8ggigny473.jpg "/>

And see if the code in program is back in the past?

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/58/A3/wKioL1S2kYbgz0kxAACfBVCWAH8487.jpg "title=" 7.7. PNG "alt=" wkiol1s2kybgz0kxaacfbvcwah8487.jpg "/>

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?

This article is from the "Little Flying Cow" blog, please be sure to keep this source http://blackstorm.blog.51cto.com/5528935/1604113

Windows installation tortoisegit detailed usage Tutorial "basics"

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.