1 introduction

1.1 the Git

Git is the most advanced distributed version control system in the world.

1.1 Differences between Git and SVN

The SVN is a centralized version control system, and the version library is centralized on the central server. People working together connect to the server via a client to pull out the latest files or submit updates.

  • Advantages: Administrators can also easily control the permissions of each developer
  • Cons: Requires an Internet connection to work; Centralized management, once the server failure, all people will not work together; The server disk is damaged and all historical updates may be lost.

Git is a distributed version control system with no central server. Instead of just taking snapshots of the latest version of files, clients mirror the entire repository. This way, a failure of any of the co-operating servers can be later recovered using any of the mirrored local repositories.

Most operations in Git only require access to local files and resources, which means you can do almost anything when you’re offline or without a VPN. You can happily submit until an Internet connection is available.

1.2 making

Github is a project code hosting platform that uses Git to manage project code. Github’s website is github.com/

2 Installation and Use of Git in Windows

2.1 msysgit

Msysgit is the Windows version of Git version control system. Download it at gitforWindows.org/

Part of the installation page explanation:

1. Set environment variables and choose which command line tool to use

  • (1) Use Git Bash command line tool. I usually pick this one.
  • (2) The system has its own command line tool, that is, Windows CMD.
  • Exe and sort.exe will overwrite the find.exe and sort.exe tools in Windows. If you do not know these tools, do not select them.

2. Configure newline conversion

  • Git will convert LF to CRLF when checking out files. CRLF will be converted to LF when the file is submitted. For cross-platform projects, this is the recommended setting on Windows.
  • (2) Git does not perform any conversions when checking out files. CRLF will be converted to LF when the file is submitted. For cross-platform projects, this is the recommended setting on Unix
  • (3) Git does not perform any conversions when checking out or committing files. This option is not recommended for cross-platform projects.

CRLF stands for \r\n, which is the newline character on Windows. LF stands for \n, which is a newline character on Unix/Linux/Mac OS X.

After the installation is complete, open Git Bash and type Git –version to display the version number.

2.2 Tortoisegit

Git is command line based and very difficult to use. Tortoisegit is a graphical Git tool for Windows. (As Tortoisegit is only a shell, you need to install MsysGit when using it.)

Website address: tortoisegit.org/ download address: tortoisegit.org/download/, language pack or download it here.

2.2.1 installation

TortoiseGit installation is simple, basic default next step.

Part of the installation page explanation:

1. Select an SSH client.

  • (1) Based on PuTTY, it is optimized for TortoiseGit and better integrated with Windows.
  • (2) Use OpenSSH, Git’s default SSH client.

2.2.2 configuration

After the installation is complete, you will be asked to restart the system. You can set up the first startup wizard (it will automatically pop up). If restart is selected directly, it can be configured directly in Settings (see below).

(1) Language selection

Here we can first do not operate, to wrap the Chinese language, and then click Refresh button, the drop-down options more Chinese (simplified) options.

(2) Set the user name and email address

The name and Email are your Github username and Email address.

2.2.3 Simple use

(1) Create a warehouse

Create a repository on Github, which can be public or private.

(2) Clone warehouse

Right-click in your local folder ->Git Clone

Enter the URL of the Github repository. A directory is a local folder directory.

(3) Submit the code

Git is different from SVN in that it is divided into two steps: commit to local repository and synchronize to Github repository.

(4) Save your password After running the first startup wizard, you will be asked to enter your password when submitting it for the first time. Later, TortoiseGit remembers the password and does not need to type it again. (This is actually the case for version 2.8, not for older versions.)

If you are not running the first startup wizard, you need to configure it yourself.

Right-click -> TortoiseGit -> Settings

You can choose to re-run the First startup wizard (above) or manually configure it (below).

Credentials are set up to save your password so you don’t have to enter it every time.


In addition, here is the web version of Pro Git: git-scm.com/book/zh/v2