Install Git on Windows 11

1. Download the latest version of the Git installation package from the official website

Official website download link: Git – Downloading Package

Select the version to download according to your computer system

Two, installation

1. Run the installer

After running the downloaded Git installation program, the following installation interface pops up, click Next

2. Select the installation location and click Next

3. Enter the installation configuration interface, select the configuration you need, and click Next after the selection is complete.

Note: The configuration items are described as follows:

 (recommended to check) Additional icons
On the Desktop Adds an icon on the desktop
(It is recommended to check) Windows Explorer integration Integrates the right mouse button menu in Windows Explorer
Git Bash Here
Git GUI Here Git
(recommended to check) Git LFS (Large File Support) large file support
(It is recommended to check) Associate .git* configuration files with the default text editor to associate the .git configuration file with the default text editor
(It is recommended to check) Associate .sh files to be run with Bash Associate .sh files to run with Bash
(Check as needed) Check daily for Git for Windows updates Check whether Git has Windows updates every day
(It is recommended to check) (NEW!) Add a Git Bash Profile to Windows Terminal Add the configuration file of Git Bash to the configuration file in the Windows terminal (this is a new function of version 2.34.1, which saves the need for an additional separate add)

4. Select the start menu folder here, and click Next

5. Select the default editor window of Git, just click Next

6. Adjust the name of the initial branch in the new repository

  • Let Git Decide
    Git decides by itself, the current default is master
  • Override the default branch name for new repositories
    Fill in the default branch by yourself, commonly used are “main”, “truck”, “development”
  • You can choose the initial name according to your preferences, and then click Next

7. Generate a list that works for you

(1) Use Git from Git Bash only
This is the safest option, since your PATH will not be modified at all. You can only use the Git command line tools with Git Bash.
(2) Use Git from the Windows Command Prompt
This option is considered safe as it only adds some minimal Git packages to PATH to avoid confusing the environment with optional Unix tools. You will be able to use Git from Git Bash and Windows Command Prompt.
(3) Use Git and optional Unix tools from the Windows Command Prompt
Use Git and optional Unix tools from the Windows command prompt
Both Git and optional Unix tools will be added to your computer’s PATH

8. Select the SSH executable file, select the open SSH, and then click Next.

9. Select the HTTPS transport backend

(1) Use the OpenSSL library
Using the OpenSSL library
The server certificate will be verified using the ca-bundle.crt file
(2) Use the native Windows Secure Channel library
Using the native Windows secure channel library
The server certificate will be verified using the Windows certificate store. This option also allows you to use your company’s internal root CA certificate, e.g. via Active Directory Domain Services

10. Configure line ending interpreter

(1) Checkout Windows-style, commit Unix-style line endings
Git will convert LF to CRLF when checking out text files. When submitting text files, CRLF will be converted to LF. For cross-platform projects, this is the recommended setting on Windows (“core.autocrlf” set to “true”)
(2) Checkout as-is, commit Unix-style line endings
Git does not perform any conversions when checking out text files. CRLF will be converted to LF when submitting text files. For cross-platform projects, this is the recommended setting on Unix (“core.autocrlf” set to “input”)
(3) Checkout as-is, commit as-is
Git does not perform any transformations when checking out or committing text files. This option is deprecated for cross-platform projects (“core.autocrlf” is set to “false”)

11. Configure the terminal emulator

(1) Use MinTTY (the default terminal of MSYS2)
Git Bash will use MinTTY as a terminal emulator with resizable windows, non-rectangular selections, and Unicode fonts. Windows console programs (such as interactive Python) must be started via ‘winpty’ to run in MinTTY.

(2) Use Windows’ default console window
Git will use Windows’ default console window (“cmd.exe”), which can be used with Win32 console programs such as interactive Python or node.js, but the default rollback is very limited and needs to be configured to use unicode fonts to correctly display non-ASCII characters, and prior to Windows 10, its windows were not freely resizable and only allowed rectangular text selection.

12. Choose the default behavior of Giy Pull

Default: fast forward or merge

Rebase: Rebase

Only ever fast-forward: only fast forward

13. Select the credential helper and select the default

14. Configure additional features, just select the default

15. Additional experimental configuration options, it is recommended not to check

16. Installation

3. Whether the verification is successful

Press the keyboard key win + R to bring up the run box, enter cmd to bring up the command prompt, enter git --version

If the corresponding version information number appears as shown in the figure below, it proves that Git has been successfully installed

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledgeGit skill treeHome pageOverview 4199 people are studying systematically