1. 程式人生 > >Win10安裝Git詳解

Win10安裝Git詳解

Git是一個開源的分散式版本控制系統,可以有效、高速的處理從很小到非常大的專案版本管理。具體安裝步驟如下:

第一步:先從官網下載最新版本的Git

官網地址:https://git-scm.com/downloads

 

 

點選上圖中表示的地方進行下載,得到Git-2.17.1.2-64-bit.exe檔案。如果你的系統是32位的,可以通過如下方式下載:

 

 

第二步:雙擊下載好的git安裝包,彈出提示框,如下圖:

 

 

第三步: 直接點選“Next”進入下一步,選擇安裝路徑,如下圖:

 

 

第四步:選擇好安裝路徑後,點選“Next”進入下一步,彈出安裝配置視窗,包括git命令列、git圖形視窗等,如下圖所示:

 

 

Additional icons 附加圖示
​ On the Desktop 在桌面上
Windows Explorer integration  Windows資源管理器整合滑鼠右鍵選單
​ Git Bash Here
​ Git GUI Here
Git LFS (Large File Support)  大檔案支援
Associate .git* configuration files with the default text editor  將 .git 配置檔案與預設文字編輯器相關聯
Associate .sh files to be run with Bash  將.sh檔案關聯到Bash執行
Use a TrueType font in all console windows  在所有控制檯視窗中使用TrueType字型
Check daily for Git for Windows updates  每天檢查Git是否有Windows更新

第五步:按照上述預設配置,直接點選“Next”進入下一步,彈出“選擇開始選單資料夾”的視窗,如下圖所示:

 

 

第六步:按照預設路徑即可,直接點選“Next”,進入下一步,進入“選擇Git使用的預設編輯器”視窗,如下圖所示:

 

 

Use the Nano editor by default  預設使用 Nano 編輯器
Use Vim (The ubiquitous text editor) as Git's default editor  使用 Vim 作為 Git 的預設編輯器
Use Notepad++ as Git's default editor  使用 Notepad++ 作為 Git 的預設編輯器
Use Visual Studio Code as Git's default editor  使用 Visual Studio Code 作為Git 的預設編輯器
Use Visual Studio Code Insiders as Git's default editor  使用Visual Studio Code Insiders 作為 Git 的預設編輯器

第七步:點選“Next”,進入下一步,進入“調整Path環境變數”視窗,如下圖所示:

 

 

配置PATH環境
Use Git from Git Bash only
This is the safest choice as your PATH will not be modified at all.You will only be able to use the Git command line tools form Git Bash.
這是最安全的選擇,因為您的PATH根本不會被修改。您只能使用 Git Bash 的 Git 命令列工具。

Use Git from the Windows Command Prompt
This option is considered safe as it only adds some minimal Git wrappers to your PATH to avoid cluttering your environment with optional Unix tools . You will be able to use Git from both Git Bash and the Windows Command Prompt.
這個選項被認為是安全的,因為它只向PATH新增一些最小的 Git包,以避免使用可選的Unix工具混淆環境。 您將能夠從 Git Bash 和 Windows 命令提示符中使用 Git。

Use Git and optional Unix tools from the Windows Command Prompt
從Windows命令提示符使用Git和可選的Unix工具
Both Git and the optional Unix tools will be added to you PATH
Git和可選的Unix工具都將新增到您計算機的 PATH 中
Warning:This will override Windows tools like "find and sort".Only use this option if you understand the implications.
警告:這將覆蓋Windows工具,如 “ find 和 sort ”。只有在瞭解其含義後才使用此選項。

第八步:選第二項,然後點選“Next”進入下一步,選擇HTTPS傳輸後端,如下圖所示:

 

 

Use the OpenSSL library
使用 OpenSSL 庫
Server certificates will be validated using the ca-bundle.crt file.
伺服器證書將使用ca-bundle.crt檔案進行驗證。

Use the native Windows Secure Channel library
使用本地 Windows 安全通道庫
Server certificates will be validated using Windows Certificate Stores.This option also allows you to use your company's internal Root CA certificates distributed e.g. via Active Directory Domain Services.
伺服器證書將使用Windows證書儲存驗證。此選項還允許您使用公司的內部根CA證書,例如, 通過Active Directory Domain Services 。

第九步:選擇"Use the OpenSSL library",點選“Next”進入下一步,配置行結束符,如下圖所示:

 

 

Checkout Windows-style,commit Unix-style line endings
Git will convert LF to CRLF when checking out text files.When committing text files,CRLF will be converted to LF .For cross-pltform projects,this is the recommended setting on Windows ("core.autocrlf" is set to "true")
在檢出文字檔案時,Git會將LF轉換為CRLF。當提交文字檔案時,CRLF將轉換為LF。 對於跨平臺專案,這是Windows上推薦的設定(“core.autocrlf”設定為“true”)

Checkout as-is , commit Unix-style line endings
Git will not perform any conversion when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform projects,this is the recommended setting on Unix ("core.autocrlf" is set to "input")
在檢出文字檔案時,Git不會執行任何轉換。 提交文字檔案時,CRLF將轉換為LF。 對於跨平臺專案,這是Unix上的推薦設定 (“core.autocrlf”設定為“input”)

Checkout as-is,commit as-is
Git will not perform any conversions when checking out or committing text files.Choosing this option is not recommended for cross-platform projects ("core.autocrlf"is set to "false")
在檢出或提交文字檔案時,Git不會執行任何轉換。對於跨平臺專案,不推薦使用此選項(“core.autocrlf”設定為“false”)

第十步:選擇第一項,點選“Next”進入下一步,配置終端模擬器,如下圖所示:

 

 

Use MinTTY (the default terminal of MSYS2)
Git Bash will use MinTTY as terminal emulator,which sports a resizable window,non-rectangular selections and a Unicode font. Windows console programs (such as interactive Python) must be launched via 'winpty' to work in MinTTY.
Git Bash將使用MinTTY作為終端模擬器,該模擬器具有可調整大小的視窗,非矩形選區和Unicode字型。 Windows控制檯程式(如互動式Python)必須通過'winpty'啟動才能在MinTTY中執行。

Use Windows' default console window
Git will use the default console window of Windows ("cmd.exe"),which works well with Win32 console programs such as interactive Python or node.js , but has a very limited default scroll-back,needs to be configured to use aUnicode font in order to display non-ASCII characters correctly,and prior to Windows 10 its windows was not freely resizable and it only allowed rectangular text selections.
Git將使用Windows的預設控制檯視窗(“cmd.exe”),該視窗可以與Win32控制檯程式(如互動式Python或node.js)一起使用,但預設的回滾非常有限,需要配置為使用unicode 字型以正確顯示非ASCII字元,並且在Windows 10之前,其視窗不能自由調整大小,並且只允許矩形文字選擇。

第十一步:選擇第一項,直接點選“Next”進入下一步,配置額外選項,如下圖所示:

 

 

Enable file system caching
啟用檔案系統快取
File system data will be read in bulk and cached in memory for certain operations ("core.fscache" is set to "true"). This provides a significant performance boost.
檔案系統資料將被批量讀取並快取在記憶體中用於某些操作(“core.fscache”設定為“true”)。 這提供了顯著的效能提升。

Enable Git Credential Manager
啟用Git憑證管理器
The 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 or later).
Windows的Git憑證管理器為Windows提供安全的Git憑證儲存,最顯著的是對Visual Studio Team Services和GitHub的多因素身份驗證支援。 (需要.NET Framework v4.5.1或更高版本)。

Enable symbolic links
啟用符號連結
Enable symbolic links (requires the SeCreateSymbolicLink permission).Please note that existing repositories are unaffected by this setting.
啟用符號連結(需要SeCreateSymbolicLink許可權)。請注意,現有儲存庫不受此設定的影響。

第十二步:使用預設配置,直接點選“Install”開始安裝,如下圖所示:

 

第十三步:安裝完成