Git Windows installation tutorial (version 2.35.1.2)

1. Git download

Go to the Git official website to download the corresponding system software, the download address is git-scm.com or gitforwindows.org
上面的 git-scm 是 Git 的官方,里面有不同系统不同平台的安装包和源代码,而 gitforwindows.org 里只有 windows 系统的安装包

2. Git installation

The version I downloaded is Git-2.35.1.2-64-bit.exe, and then we will install this version.

2.1 License statement

Double-click the downloaded Git-2.35.1.2-64-bit.exe to start the installation. This interface mainly shows the content of the GPL version 2 agreement. Click Nextto go to second step.
insert image description here

2.2 Select the installation directory

You can click "Browse..." to change the directory, or you can directly change it in the box. After the modification is completed, click nextto go to third step.
insert image description here

2.3 Select installation components

I have translated the general meaning of the English in the picture, and you can choose to check according to your own needs. Click nextto go to step 4.
insert image description here

2.4 Select the start menu folder

Git in the box can be changed to another name, or click “Browse…” to select another folder. Ok, click Nextto go to the next step
insert image description here

2.5 Select Git default editor

There are 10 built-in editors in the Git installer for you to choose from, such as Atom, Notepad, Notepad++, Sublime Text, Visual Studio Code, Vim, etc. The default is Vim. After selecting Vim, you can go directly to the next step, but Vim is The pure command line is a bit difficult to operate and needs to be learned. If you choose another editor, you need to go to its official website to install it before proceeding to the next step.
insert image description here
The picture below shows the default editor Vim, you can directly click nextto go to the sixth step.
insert image description here
If you don't want to use Vim as the default editor, change it to another one, such as Notepad++, then you need to click the blue font "Notepad++" below to go to its official website to download and install it before proceeding to the next step. After next
insert image description here
installation 我的电脑->属性->高级系统设置->高级->环境变量->系统变量->Path->编辑++ , such as C:\Program Files\notepad++.
In this way, you can directly call Notepad++ in Git Bash.
Call the command$ notepad++ 文件名.后缀 //在 git bash 调用 notepad++ 打开文件

2.6 Deciding to initialize the trunk name of the new project (warehouse)

The first is to let Git choose by itself, the name is master, but it may be changed to other names in the future; the second is for us to decide on our own, the default is main, of course, you can also change it to other names. Generally, the first type is defaulted, click nextto go to the seventh step.
insert image description here

2.7 Adjust your path environment variable

insert image description here

  • The first is to use Git only from Git Bash. This means that you can only use Git through Git Bash after Git is installed, and other third-party software such as command prompts will not work.
  • The second is Git from the command line as well as third-party software. This is third-party support on the first basis, you will be able to use Git from Git Bash, command prompt (cmd) and Windows PowerShell, and any third-party software that can find Git from Windows system environment variables. It is recommended to use this.
  • The third is to use Git and optional Unix tools from a command prompt. Selecting this will override Windows tools such as "find and sort". Use this option only if you understand its implications. In a word, it is suitable for those who understand better.

Novices choose the second option by default, clickNext

2.8 Select the SSH executable file

insert image description here

  • Use bundled OpenSSH: This one uses ssh. Git comes with it.
  • Use External OpenSSH: This will use an external ssh.exe. Git does not install its own OpenSSH (and related) binaries, but uses them as they are found in the PATH.

Choose according to your needs, normally choose the first one, clickNext

2.9 Select HTTPS backend transport

insert image description here
As an ordinary user, just use Git to visit websites such as Github and GitLab, and just choose the former. Click nextto go to step ten.

2.10 Configure end-of-line conversion

insert image description here
The three options are:

  • Check out Windows-style, submit Unix-style line endings.
  • Check out as-is, commit Unix-style line endings.
  • Check out as is, commit as is.

Our tutorial is to introduce how to install Git for Windows, select the first item and clickNext

2.11 Configuring a terminal emulator for use with Git Bash

insert image description here
It is recommended to choose the first one. MinTTY 3 has more functions than cmd. cmd is more suitable than MinTTY to deal with some interface problems of Windows. This is not very useful for Git. In addition, the default console window ('cmd') of Windows has Lots of disadvantages like cmd has a very limited default history scrollback stack and bad font encoding etc.
In contrast, MinTTY has a resizable window and other useful configurable options that can be opened via the right-click toolbar of git-bash. Click nextto go to step 12.

2.12 Choosing the default "git pull" behavior

insert image description here
git pull is to get the latest remote warehouse branch to the local and merge with the local branch

The above gives three "git pull" behaviors:

  • The first one is merge
  • The second is rebase
  • The third is to directly obtain

Generally, the first item is selected by default, and then click Next. Most programmers don't use git rebase well or don't understand it, and it's very risky, but many people who can use it also highly recommend it, but if it's not used well, it's a disaster.

git pull just pulls the remote branch and merges it with the local branch, while git fetch just pulls the remote branch, how to merge, choose merge or rebase, you can choose again.

2.13 Selecting a credential helper

insert image description here
There are two options:

  • Git credential management
  • Without using credential helpers

The preceding options are there to help with login credentials, and Git sometimes requires the user's credentials to perform operations; for example, a username and password may be required to access a remote repository (GitHub, GItLab, etc.) over HTTP. Click nextto go to fourteen steps

2.14 Configure additional options

insert image description here
There are two options:

  • Enable filesystem caching
  • enable symlinks

Enabling file system caching means reading file system data in batches and caching them in memory for certain operations, which can significantly improve performance. This option is enabled by default.
Enable symbolic link, symbolic link is a special kind of file, which contains a reference pointing to other files or directories in the form of absolute path or relative path, similar to the Windows shortcut, not exactly the same as under Unix (such as Linux) symbolic link. Because the support of this function requires some conditions, it is not enabled by default. Click nextto go to step fifteen.

2.15 Configuring Experimental Options

insert image description here
This is an experimental feature, there may be some minor bugs and the like, it is recommended not to enable it.
Click installto install.

2.16 The installation is successful

insert image description here

Guess you like

Origin blog.csdn.net/a6661314/article/details/122975744