Git installation and TortoiseGit detailed tutorial [Basics]
Tags: TortoiseGit
Environment: win8.1 64bit
Installation Preparation:
-
First you have to install git under Windows msysgit1.9.5
-
Install version control client TortoiseGit tortoisegit1.8.12.0 [32 and 64 do not download the wrong, not used to English friends, can also be the next language pack]
First, the installation diagram:
-
GIT default install all the way to []
After installing git, right, you will find more than a few menu options for the GIT
2. Install tortoisegit [way] to default
After installing, right, you will find several options on the menu more tortoisegit
This installation be considered complete, compared to tortoiseSVN, installing tortoiseGIT do not need to restart the computer.
Next is the use tortoiseGIT
Second, the use of illustration tortoiseGIT
Here just do demonstrate some of the most basic functions:
Create repository, submit (commit) file, push (push) file, update the file, create a branch.
Description: git distributed version control belong, in fact, everyone's computer is a complete repository; two people write such a project in the LAN, then the two men inside the computer is a complete project, when there is a new time code appears directly to each other to push. Of course, when many people, not inside the LAN, it is impossible to push everyone, git solution is used as a centralized repository using a computer, the new code will push everyone to go above the quest in time to pull on your computer. Github is more famous abroad, and domestic oschina is also well known.
-
Creating a repository
Create a folder GitDemo, then right --Git Create repository here ...
Here do not check Make is Bare
OK, next time in more than a folder GitDemo .git folder [Computer To set to show hidden folders]
This folder, try not to mess modified or deleted.
2. Create a file, and then submitted to (commit) to the repository [This operation can operate in offline]
2.1 Select Git Commit -> "master"
2.2 Fill message, check to commit the file, and then click OK. It will pop up a window click to close.
3. Then add a new method method in the program. When the file code changes, then the file will appear as a red exclamation point
4. The new code into the repository, the reference step 2.1 and 2.2.
5. View Log
In the log file information to change, very clear.
6. Code push (push) to the cloud, for example: github, oschina above
6.1: Create a new project on oschina, enter oschina -> Git @ OSC -> New Project
Click Create Project, below the red line is the URL of the project
The computer code is obtained 6.2 push to the cloud.
Right -> tortoiseGit -> push
Set up URL, OK. And then began to push, enter a user name and password on OK
Enter your user name, later also enter the password, and then wait for success.
6.3 is successful, we go oschina on the project and see it push
7.git there is a particularly useful feature, branch.
I found the problem: You write a lot of code, run OK; but suddenly want to add new features into this feature you do not know whether the normal operation, and modify the process, in addition to the newly added code and files in it, but also modify previous code. If the case fails, modify the back is a very troublesome thing. This time a lot of people with a backup. Git is a look at how to deal with this problem elegantly.
Treatment of git: When you want to add a new feature into it, you can create a new branch, such as name newfunction, then branch to the new features add to, if OK, the code is merged into the master branch, if the new function fails, switch back to the master branch up in newfunction write code, I can not see the whole.
[Ps: master is the main branch of the New Project]
7.1 Create a new branch, right -> tortoiseGit -> Create Branch
Right, you will find the current branch to branch of your new newfunction
7.2 Next, increase your fun new features; we then proprame.txt not only increase the show method, also modified the method metho
7.3 submit our code, we find this new feature at this time does not work, there are many loopholes and so on. We want to return to the previous code. How to do it?
7.4 In order to return to previous projects, we cut directly into your master branch.
Now take a look at the contents of the file, the newly added and modified are.
Then we switch to the master branch, right -> tortoiseGit -> Switch / Checkout
Select the master can then determine
Look at the program whether the code back to the past it?
Whether modify, or add, did not affect the recovery. This is the role of the branch. This function is not to make you save a lot of work yet.
Source: http: //www.mamicode.com/info-detail-423481.html
Original Address: http: //blog.51cto.com/blackstorm/1604113
Tags: TortoiseGit
Environment: win8.1 64bit
Installation Preparation:
-
First you have to install git under Windows msysgit1.9.5
-
Install version control client TortoiseGit tortoisegit1.8.12.0 [32 and 64 do not download the wrong, not used to English friends, can also be the next language pack]
First, the installation diagram:
-
GIT default install all the way to []
After installing git, right, you will find more than a few menu options for the GIT
2. Install tortoisegit [way] to default
After installing, right, you will find several options on the menu more tortoisegit
This installation be considered complete, compared to tortoiseSVN, installing tortoiseGIT do not need to restart the computer.
Next is the use tortoiseGIT
Second, the use of illustration tortoiseGIT
Here just do demonstrate some of the most basic functions:
Create repository, submit (commit) file, push (push) file, update the file, create a branch.
Description: git distributed version control belong, in fact, everyone's computer is a complete repository; two people write such a project in the LAN, then the two men inside the computer is a complete project, when there is a new time code appears directly to each other to push. Of course, when many people, not inside the LAN, it is impossible to push everyone, git solution is used as a centralized repository using a computer, the new code will push everyone to go above the quest in time to pull on your computer. Github is more famous abroad, and domestic oschina is also well known.
-
Creating a repository
Create a folder GitDemo, then right --Git Create repository here ...
Here do not check Make is Bare
OK, next time in more than a folder GitDemo .git folder [Computer To set to show hidden folders]
This folder, try not to mess modified or deleted.
2. Create a file, and then submitted to (commit) to the repository [This operation can operate in offline]
2.1 Select Git Commit -> "master"
2.2 Fill message, check to commit the file, and then click OK. It will pop up a window click to close.
3. Then add a new method method in the program. When the file code changes, then the file will appear as a red exclamation point
4. The new code into the repository, the reference step 2.1 and 2.2.
5. View Log
In the log file information to change, very clear.
6. Code push (push) to the cloud, for example: github, oschina above
6.1: Create a new project on oschina, enter oschina -> Git @ OSC -> New Project
Click Create Project, below the red line is the URL of the project
The computer code is obtained 6.2 push to the cloud.
Right -> tortoiseGit -> push
Set up URL, OK. And then began to push, enter a user name and password on OK
Enter your user name, later also enter the password, and then wait for success.
6.3 is successful, we go oschina on the project and see it push
7.git there is a particularly useful feature, branch.
I found the problem: You write a lot of code, run OK; but suddenly want to add new features into this feature you do not know whether the normal operation, and modify the process, in addition to the newly added code and files in it, but also modify previous code. If the case fails, modify the back is a very troublesome thing. This time a lot of people with a backup. Git is a look at how to deal with this problem elegantly.
Treatment of git: When you want to add a new feature into it, you can create a new branch, such as name newfunction, then branch to the new features add to, if OK, the code is merged into the master branch, if the new function fails, switch back to the master branch up in newfunction write code, I can not see the whole.
[Ps: master is the main branch of the New Project]
7.1 Create a new branch, right -> tortoiseGit -> Create Branch
Right, you will find the current branch to branch of your new newfunction
7.2 Next, increase your fun new features; we then proprame.txt not only increase the show method, also modified the method metho
7.3 submit our code, we find this new feature at this time does not work, there are many loopholes and so on. We want to return to the previous code. How to do it?
7.4 In order to return to previous projects, we cut directly into your master branch.
Now take a look at the contents of the file, the newly added and modified are.
Then we switch to the master branch, right -> tortoiseGit -> Switch / Checkout
Select the master can then determine
Look at the program whether the code back to the past it?
Whether modify, or add, did not affect the recovery. This is the role of the branch. This function is not to make you save a lot of work yet.
Source: http: //www.mamicode.com/info-detail-423481.html
Original Address: http: //blog.51cto.com/blackstorm/1604113