Windows will teach you how to install git (developers must know it)

Teach you how to install git under Windows

  1. Go to Git official website to download, website address: https://git-scm.com/downloads
  2. Double click to run
    insert image description here
  3. Choose the installation path
    insert image description here
  4. Select installation components (recommended to select all)

The options in the red box are checked by default, and it is recommended not to move them. Green box 1 is to decide whether to create a shortcut on the desktop. Green box 2 is the decision to use TrueType fonts in all console windows and whether to check Git daily for Windows updates. These are selected according to your needs.

insert image description here
5. Create a menu folder, it is recommended to go to the next step
insert image description here
6. Select the default editor for git files, it is recommended to go to the next step
insert image description here
7. Set environment variables, it is recommended to choose the second

The first configuration is "Use Git only from Git Bash". This is the safest option, since your PATH will not be modified at all. You can only use the Git command line tool with Git Bash. But this will not work with third-party software;
the second configuration is "Git from the command line as well as third-party software". This option is considered safe because it only adds some minimal Git wrappers to PATH to avoid cluttering the environment with optional Unix tools. You'll be able to use Git from Git Bash, Command Prompt, and Windows PowerShell, as well as any third-party software that looks for Git in your PATH. This is also the recommended option;
the third configuration is "Use Git and optional Unix tools from a command prompt". WARNING: This will override Windows tools like "find and sort". Use this option only if you understand its implications.

insert image description here
8. Select the SSL certificate, it is recommended to go directly to the next step

The first option is "Use OpenSSL library". The server certificate will be verified using the ca-bundle.crt file. This is the option we usually use;
the second option is "Use local 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, for example through Active Directory Domain Services.

insert image description here
9. Configure the end-of-line symbol conversion, it is recommended to choose the first one

The first option is "Check out Windows-style, commit Unix-style line endings". When checking out a text file, Git converts LF to CRLF. CRLF will be converted to LF when submitting text files. For cross-platform projects, this is the recommended setting on Windows ("core.autocrlf" set to "true"); the
second option is "Checkout as-is, commit with Unix-style line endings". Git doesn't 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"); the
third option is "checkout as-is, commit as-is". Git does not perform any transformations when checking out or committing text files. This option is not recommended for cross-platform projects ("core.autocrlf" is set to "false")

insert image description here
11. Configure terminal emulator to work with git bash

The first option is "Use MinTTY (MSYS2's default terminal)". 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; the
second option is "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.

insert image description here
12. Configure additional options, it is recommended to go directly to the next step

The first option is "Enable file system caching". Filesystem data will be read in batches and cached in memory for some operations ("core.fscache" set to "true"). This provides a significant performance boost;
the second option is "Enable Git Credentials Manager". Git Credential Manager for Windows provides secure Git credential storage for Windows, most notably multi-factor authentication support for Visual Studio Team Services and GitHub. (requires .NET Framework v4.5.1 or higher);
the third option is "Enable Symbolic Links". Enable symbolic links (requires SeCreateSymbolicLink permission). Note that existing repositories are not affected by this setting.

insert image description here
13. Configure the experimental options and go to the next step

Enable experimental builtins add -i/-p. (NEW!) Use the experimental built-in interactive add ("git add -i" or "git add -p"). This makes it faster (especially to boot!), but not yet considered reliable.

insert image description here
14. Wait for the installation to complete
insert image description here
15. The installation is complete
insert image description here
16. Start the test

After the installation of Git is complete, you can see the three startup icons of Git in the start menu (Git Bash, Git CMD (Deprecated), Git GUI)

insert image description here
insert image description here
insert image description here
Common problems in use

  • If Chinese is not displayed normally, please right-click and select "option" to change the language.
    insert image description here

Guess you like

Origin blog.csdn.net/jinba225/article/details/123472130