【學(xué)了就忘】Git介紹 — 4.Git的安裝

本文講解Windows下Git的安裝

一 、Git的下載

進(jìn)入官方地址:https://git-scm.com/download/win

Git下載

二 缰儿、Git在Windows下的詳細(xì)安裝

2.1. 運(yùn)行Git安裝文件

Git安裝圖

Step 1 Information(信息)

說(shuō)明:
Please read the following important information before continuing
繼續(xù)之前,請(qǐng)閱讀以下重要信息
Git安裝圖1

Step 2 Select Destination Location

選擇安裝位置

Git安裝圖2

Step 3 Select Components

選擇組件

關(guān)于Git GUI Here瘾婿。目前我都是使用Git Bash來(lái)進(jìn)行操作馒胆。使用Git GUI確實(shí)可以得到更好的UI體驗(yàn)热康,不過(guò)個(gè)人認(rèn)為會(huì)減低效率消返。并且初學(xué)者還是先搞懂Git的常用指令之后载弄,再使用Git GUI才會(huì)有更好的理解。

Git安裝圖3
說(shuō)明:
(1)Additional icons: 附加圖標(biāo)
(2)On the Desktop:在桌面上
(3)Windows Explorer integration Windows:資源管理器集成鼠標(biāo)右鍵菜單
Git Bash Here
Git GUI Here
(4)Git LFS (Large File Support):大文件支持
(5)Associate .git/* configuration files with the default text editor:將 .git 配置文件與默認(rèn)文本編輯器相關(guān)聯(lián)
(6)Associate .sh files to be run with Bash:將.sh文件關(guān)聯(lián)到Bash運(yùn)行
(7)Use a TrueType font in all console windows:在所有控制臺(tái)窗口中使用TrueType字體
(8)Check daily for Git for Windows updates:每天檢查Git是否有Windows更新

Step 4 Select Strat Menu Folder

創(chuàng)建開始菜單目錄(開始菜單目錄名設(shè)置)

Git安裝圖4

Don't create a Start Menu folder
不創(chuàng)建“開始”菜單文件夾撵颊,不勾選宇攻。

Step 5 Choosing the default editor used by Git

選擇Git使用的默認(rèn)編輯器

Git安裝圖5
說(shuō)明:
Use the Nano editor by default:默認(rèn)使用 Nano 編輯器
Use Vim (The ubiquitous text editor) as Git's default editor:使用 Vim 作為 Git 的默認(rèn)編輯器
Use Notepad++ as Git's default editor:使用 Notepad++ 作為 Git 的默認(rèn)編輯器
Use Visual Studio Code as Git's default editor:使用 Visual Studio Code 作為 Git 的默認(rèn)編輯器
Use Sublime Text as Git's default editor:使用 Sublime Text 作為 Git 的默認(rèn)編輯器

可選操作根據(jù)自己習(xí)慣。

Step 6 Adjusting your PATH environment

配置PATH環(huán)境

Git安裝圖6
說(shuō)明:
(1)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.
翻譯:這是最安全的選擇倡勇,因?yàn)槟腜ATH根本不會(huì)被修改逞刷。您只能使用 Git Bash 的 Git 命令行工具。
(2)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.
翻譯:這個(gè)選項(xiàng)被認(rèn)為是安全的,因?yàn)樗幌騊ATH添加一些最小的 Git包夸浅,以避免使用可選的Unix工具混淆環(huán)境仑最。 您將能夠從 Git Bash 和 Windows 命令提示符中使用 Git。(也就是在Windows的命令行cmd中也可以運(yùn)行g(shù)it命令题篷,操作上帶來(lái)方便
(3)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工具都將添加到您計(jì)算機(jī)的 PATH 中
Warning:This will override Windows tools like "find and sort".Only use this option if you understand the implications.
警告:這將覆蓋Windows工具词身,如 “ find 和 sort ”。只有在了解其含義后才使用此選項(xiàng)番枚。

選擇默認(rèn)第二項(xiàng):會(huì)自動(dòng)配置好git命令的環(huán)境變量。
第一項(xiàng)簡(jiǎn)述:直接安裝损敷,不會(huì)配置git命令的環(huán)境變量葫笼,需要手動(dòng)配置環(huán)境變量。
第三項(xiàng):基本沒(méi)用拗馒。

Step 7 Choosing HTTPS transport backend

選擇HTTPS傳輸后端路星,也就是使用哪個(gè)加密庫(kù)來(lái)加密http傳輸?shù)男畔ⅲJ(rèn)是使用openssl诱桂,一般都是使用默認(rèn)設(shè)置洋丐。

Git安裝圖7
說(shuō)明:
(1)Use the OpenSSL library
使用 OpenSSL 庫(kù)
Server certificates will be validated using the ca-bundle.crt file.
服務(wù)器證書將使用ca-bundle.crt文件進(jìn)行驗(yàn)證。
(2)Use the native Windows Secure Channel library
使用本地 Windows 安全通道庫(kù)
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.
服務(wù)器證書將使用Windows證書存儲(chǔ)驗(yàn)證挥等。此選項(xiàng)還允許您使用公司的內(nèi)部根CA證書友绝,例如, 通過(guò)Active Directory Domain Services 肝劲。

Step 8 Configuring the line ending conversions

選擇提交的時(shí)候換行格式

Git安裝圖8
說(shuō)明:
(1)Checkout Windows-style,commit Unix-style line endings
翻譯:檢查出windows格式轉(zhuǎn)換為unix格式:將windows格式的換行轉(zhuǎn)為unix格式的換行再進(jìn)行提交迁客。
(2)Checkout as-is , commit Unix-style line endings**
翻譯:檢查出原來(lái)格式轉(zhuǎn)為unix格式:不管什么格式的,一律轉(zhuǎn)為unix格式的換行再進(jìn)行提交辞槐。
(3)Checkout as-is,commit as-is
不進(jìn)行格式轉(zhuǎn)換 : 不進(jìn)行轉(zhuǎn)換掷漱,檢查出什么,就提交什么榄檬。

也就是提交代碼時(shí)使用哪種風(fēng)格卜范,使用默認(rèn)設(shè)置即可。

Step 9 Configuring the terminal emulator to use with Git Bash

使用哪個(gè)軟件作為git的終端程序鹿榜,默認(rèn)使用minTTY海雪,還屬于比較好用的終端,直接使用默認(rèn)設(shè)置

Git安裝圖9
說(shuō)明:
(1)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作為終端模擬器犬缨,該模擬器具有可調(diào)整大小的窗口喳魏,非矩形選區(qū)和Unicode字體。 Windows控制臺(tái)程序(如交互式Python)必須通過(guò)'winpty'啟動(dòng)才能在MinTTY中運(yùn)行怀薛。
(2)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的默認(rèn)控制臺(tái)窗口(“cmd.exe”)刺彩,該窗口可以與Win32控制臺(tái)程序(如交互式Python或node.js)一起使用,但默認(rèn)的回滾非常有限,需要配置為使用unicode 字體以正確顯示非ASCII字符创倔,并且在Windows 10之前嗡害,其窗口不能自由調(diào)整大小,并且只允許矩形文本選擇畦攘。

Step 10 Configuring extra options

配置額外的選項(xiàng)霸妹,如是否開啟文件緩存之類的輔助功能,默認(rèn)選擇即可

Git安裝圖10
說(shuō)明:
(1)Enable file system caching
啟用文件系統(tǒng)緩存
描述: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.
翻譯:文件系統(tǒng)數(shù)據(jù)將被批量讀取并緩存在內(nèi)存中用于某些操作(“core.fscache”設(shè)置為“true”)知押。 這提供了顯著的性能提升叹螟。
(2)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憑證存儲(chǔ),最顯著的是對(duì)Visual Studio Team Services和GitHub的多因素身份驗(yàn)證支持台盯。 (需要.NET Framework v4.5.1或更高版本)罢绽。
(3)Enable symbolic links
啟用符號(hào)鏈接
描述:Enable symbolic links (requires the SeCreateSymbolicLink permission).Please note that existing repositories are unaffected by this setting.
翻譯:?jiǎn)⒂梅?hào)鏈接(需要SeCreateSymbolicLink權(quán)限)。請(qǐng)注意静盅,現(xiàn)有存儲(chǔ)庫(kù)不受此設(shè)置的影響良价。

Step 11 Installing

安裝

Git安裝圖11

Step 12 Completing the Git Setup Wizard

完成Git安裝向?qū)?/strong>

Git安裝圖12

三、驗(yàn)證Git是否安裝成功

進(jìn)入cmd和Git客戶端蒿叠,輸入git --version明垢,查看版本信息,出現(xiàn)證明安裝成功

驗(yàn)證1

在桌面右鍵市咽,顯示Git GUI Here和Git Bash Here痊银。


驗(yàn)證2
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市魂务,隨后出現(xiàn)的幾起案子曼验,更是在濱河造成了極大的恐慌,老刑警劉巖粘姜,帶你破解...
    沈念sama閱讀 218,546評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件鬓照,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡孤紧,警方通過(guò)查閱死者的電腦和手機(jī)豺裆,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,224評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)号显,“玉大人臭猜,你說(shuō)我怎么就攤上這事⊙涸椋” “怎么了蔑歌?”我有些...
    開封第一講書人閱讀 164,911評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)揽碘。 經(jīng)常有香客問(wèn)我次屠,道長(zhǎng)园匹,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,737評(píng)論 1 294
  • 正文 為了忘掉前任劫灶,我火速辦了婚禮裸违,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘本昏。我一直安慰自己供汛,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,753評(píng)論 6 392
  • 文/花漫 我一把揭開白布涌穆。 她就那樣靜靜地躺著怔昨,像睡著了一般。 火紅的嫁衣襯著肌膚如雪蒲犬。 梳的紋絲不亂的頭發(fā)上朱监,一...
    開封第一講書人閱讀 51,598評(píng)論 1 305
  • 那天,我揣著相機(jī)與錄音原叮,去河邊找鬼。 笑死巡蘸,一個(gè)胖子當(dāng)著我的面吹牛奋隶,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播悦荒,決...
    沈念sama閱讀 40,338評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼唯欣,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了搬味?” 一聲冷哼從身側(cè)響起境氢,我...
    開封第一講書人閱讀 39,249評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎碰纬,沒(méi)想到半個(gè)月后萍聊,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,696評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡悦析,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,888評(píng)論 3 336
  • 正文 我和宋清朗相戀三年寿桨,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片强戴。...
    茶點(diǎn)故事閱讀 40,013評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡亭螟,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出骑歹,到底是詐尸還是另有隱情预烙,我是刑警寧澤,帶...
    沈念sama閱讀 35,731評(píng)論 5 346
  • 正文 年R本政府宣布道媚,位于F島的核電站扁掸,受9級(jí)特大地震影響翘县,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜也糊,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,348評(píng)論 3 330
  • 文/蒙蒙 一肄满、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧徐矩,春花似錦烹玉、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,929評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至僧凰,卻和暖如春探颈,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背训措。 一陣腳步聲響...
    開封第一講書人閱讀 33,048評(píng)論 1 270
  • 我被黑心中介騙來(lái)泰國(guó)打工伪节, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人绩鸣。 一個(gè)月前我還...
    沈念sama閱讀 48,203評(píng)論 3 370
  • 正文 我出身青樓怀大,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親呀闻。 傳聞我的和親對(duì)象是個(gè)殘疾皇子化借,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,960評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容