Original URL: https://github.com/doggy8088/Learn-Git-in-30-days/blob/master/docs/02%20%E5%9C%A8%20Windows%20%E5%B9%B3% E5%8f%b0%e5%bf%85%e8%a3%9d%e7%9a%84%e4%b8%89%e5%a5%97%20git%20%e5%b7%a5%e5%85%b7.markdown
To start using Git version control, first install the right Git tool, this series of articles is mainly on the Windows platform as the main, this article will introduce three sets of our most common git version of the control tools, and introduce the differences between the several tools, and when to use what tools.
1th set: Git for Windows
It's a set of command-line tools that can be executed under the commands Prompt, and all of the Git GUI tools on the market are actually bones the bottom-up git tools, so it's a must-have git management tool.
The following is the installation process:
- Connect to the http://msysgit.github.io/official website to download the installation files
- No matter which version, download the latest version of the right
- Directly click on the downloaded file for installation.
- Installation program Welcome page
- Consent to the GPL granting of rights
- Select the installation path
- Select the component and suggest uncheck the Windows Explorer integration option!
(Because this integration tool is too solar spring, suggest using the Tortoisegit tool)
- Set the name of the program, and keep the preset option
- Here is the option to choose Run Git from the Windows Command Prompt this option!
(Because most Windows users are not familiar with Bash commands)
- Replace the line characters and suggest keeping the presets.
- Once the installation is complete, you can start using the command prompt directly
- You can enter
git --version
the instructions to inquire the current version of the tool program
2nd set: GitHub for Windows
This is a tool developed by GitHub and written to people who don't know much about git, with a simple and intimate GUI, which hides git's hard-to-understand observations and instructions. While GitHub for Windows tools are a lot more than git for Windows, it's probably not easy to get started with GitHub for Windows tools for people who have absolutely no idea about git.
GitHub for Windows has a git Shell tool that uses Git for Windows, so if you're not installing Git for windows, you won't be using GitHub for Windows git Shell tool.
This job can help you to complete the Git version of the work has been somewhat, at least the basic version of the control function has been provided, the most important to have the following capabilities:
- Clone repositories
- Copy the repository above GitHub back (git clone)
- Browse history
- Browse the version history of your local repository
- Commit changes
- Commit changes to the local storage repository
- Branch Code
- Build and manage Git branches, and switch branches to your work
- Share on github.com
- Synchronizing with GitHub changes
- "Sync" here means to integrate git pull with git push
- When GitHub for Windows is synchronized, the preset is to use the Rebase method to merge.
In addition to what most Git for Windows can do, you can't do it in GitHub for Windows! If you really want to use it in larger-scale development, you might want to consider whether it's appropriate, but if it's for non-software developers, the simple version of the job should be very adequate.
The following is a GitHub for Windows installation process:
- Connect to http://windows.github.com/to download the installation files first.
- Execute the installation directly after downloading.
- When you download GitHub for Windows, you may feel that the files are small, but when you actually install the files that you need, you must keep the Internet connection in order.
* 然後他會要求你先設定好 user.name 與 user.email 這兩個參數,這兩個是使用任何 Git 工具最重要的步驟之一,沒有設定這兩個參數是完全無法 commit 任何版本的。 備註: 這兩個參數預設會設定到 Global config 之中,也就是 "C:\Users\<user>\.gitconfig" 這個檔案。
First use if you have successfully logged in to GitHub account, GitHub for Windows will automatically create a group of SSH Key-pair C:\Users\<username>\.ssh
, which allows you to "sync" your local and remote repositories in the future without having to enter the password.
GitHub for Windows helps you to generate the SSH Key preset path as follows:
- C:\users<username>\.ssh\github_rsa
- C:\users<username>\.ssh\github_rsa.pub
SSH Key's signature section will also be transferred to the GITHUB website at the same time you log in, and you can see the SSH key signature that you've passed on from your Personal Settings screen (HTTPS://GITHUB.COM/SETTINGS/SSH):
- After GitHub for Windows is installed, it actually helps you to install a git shell tool, which is a PowerShell interface operating environment, and in many cases, our example will use the Git shell to do the same thing, too:
- You can use the ^ symbol in the instruction column (you cannot use the ^ symbol at the command prompt)
- You can get extra information (Prompt) from Git work.
- There is also a small lack of use of Git Shell (PowerShell)
{}
because there is a special meaning in PowerShell, if your git argument uses a {}
symbol, remember to add a ' single quote ' before the reference
3rd set: Sourcetree
This is a tool developed by ATLASSIAN This company, is a very professional GUI operation tool, not only support Git version control, but also support the mercurial version of the control system, these two versions of the control system are distributed version of the control of the classification, the concept is very similar, So it can be integrated in this set of tools.
Sourcetree In fact bones is also through the GIT for Windows Tools version of the operation, if you have nothing to install Git for Windows first, the installation of the process he will also prompt you to do not install.
Sourcetree's features are much more powerful than GitHub for Windows, and almost all of the command-line functions can be done with Sourcetree GUI interface (through mouse operation), or, if you're not familiar with Git's core view, more right-click The option is equivalent to a piece of white paper, so you don't know how to do it. But if you really know what Git is made of and what it is, using Sourcetree is definitely going to be more than enough!
The following is the Sourcetree installation process:
Connect to http://www.sourcetreeapp.com/to download the installation files first.
After downloading, the installation is executed directly, and the rest of the installation steps are pressed directly to the Next
last, and then directly to the Sourcetree program.
The first time you activate the Sourcetree, you'll be asked if you want to install Mercurial on the go, but you can't install it.
The first time you use Sourcetree, as with GitHub for Windows, you have to set the User.Name and User.email for both, but if you follow the steps in this article, this step should not be specially entered, Because the previously entered parameters have been written into the Git for Windows Global Setup, this will be brought in automatically and you can simply press Next
.
This step is to choose the right SSH Client, which is the tool required to follow the remote Git repository and choose a preset value.
The next step is to ask if you already have SSH key, because we have a github-focused SSH key in GitHub for Windows, so you can also press and Yes
Select this file in this step C:\Users\<username>\.ssh\github_rsa
(this is an SSH.). Private gold keys).
Although Sourcetree is a free software, it is necessary to continue using it after "free registration" within 30 days of installation.
Register now for a license
Enter your email address first
And then enter some personal information and set a password, you can register to complete
If you are also installing Sourcetree on another computer, you can download the license automatically by entering the password for the first time registration by downloading the registration
Registration successful
When using Sourcetree, there is an Open in Terminal feature that opens a Cygwin-like command prompt that lets you manipulate git commands directly.
4th set: Tortoisegit
Todo
Today's Little knot
Today, this NST is an introduction to three sets of common and powerful Git version of the tool under Windows, the three sets as long as they can get started, it is absolutely possible to significantly improve the efficiency of GIT version of the control, it is worth studying.
But, I badgered again, to learn to use Git GUI interface tool, must first have a complete git version of control concept, or it is really difficult to use these useful tools.
References
- Git for Windows
- GitHub for Windows
- Sourcetree
- Tortoisegit
"Go" Day No. 02: Three sets of Git tools required on Windows platform