Win7上Git安裝及配置過程

 

Win7上Git安裝及配置過程

文檔名稱

Win7上Git安裝及配置過程

創建時間

2012/8/20

修改時間

2012/8/20

創建人

Baifx

簡介(收穫)

1、在win7上安裝msysgit步驟;

2、在win7上安裝TortoiseGit步驟;

3、在VS2010中集成Git方法和步驟。

參考源

Git的配置與使用

http://wenku.baidu.com/view/929d7b4e2e3f5727a5e962a8.html

一、安裝說明

1、Git在windows平臺上安裝說明。

         Git 是 Linux Torvalds 爲了幫助管理 Linux 內核開發而開發的一個開放源碼的版本控制軟件。目前Git已經可以在windows下使用,主要方法有二:msysgit和Cygwin。Cygwin和Linux使用方法類似,Windows版本的Git提供了友好的GUI(圖形界面),安裝後很快可以上手,此處我們主要討論基於msysgit的Git安裝和使用。

         TortoiseGit是TortoiseSVN的Git版本,TortoiseGit用於遷移TortoiseSVN到TortoiseGit。一直以來Git在Windows平臺沒有好用GUI客戶端,現在TortoiseGit的出現給Windows開發者帶來福音。我們將在64win7操作系統上安裝Git,並使用GUI界面,則需同時安裝msysGitTortoiseGit

2、閱讀TortoiseGit官方安裝說明:

http://code.google.com/p/tortoisegit/wiki/SetupHowTo

System prerequisites

· For the latest version of TortoiseGit Windows XP SP3 or newer is required.

· Admin privileges for the installation

· msysGit is required by TortoiseGit

· You do not need to download the whole msysGit development package, the "Full installer for official Git for Windows" download package is sufficient

· msysGit 1.7.10+ is recommended for TortoiseGit 1.7.9+ (msysGit 1.7.10 adds utf-8 support and is compatible to *nix git)

· minimum compatible version is 1.6.1 (for TortoiseGit < 1.7.9 you should use msysGit 1.7.6)

Installation

Just download the setup package for your system and install it. If you are running a 64 bit system, you do not need to download and install the 32 bit version: The 32 bit shell extension is included in the 64 bit installer since TortoiseGit 1.7.3.0.

Windows 2000

If you want to use TortoiseGit in a Win2K environment (only 1.6.5 and below support Win2K), please install GDI+ before you install TortoiseGit. However, running these old versions is not recommended (no utf-8 and separate-git-dir support).

Upgrade

Before upgrading you should read the ReleaseNotes.

Just download the setup package for your system and install it. The old version will be replaced automatically.

If you are upgrading from 1.7.3.0 or older and you have installed the 32-bit version on a 64-bit system you have to deinstall the 32-bit version first.

Common problems (installer aborts with an error message)

"This installation package is not supported by this processor type. Contact your product vendor."

This means you are trying to install the 64-bit version of TortoiseGit on a normal 32-bit operating system. You need to download and use the correct msi file for your OS. For normal 32-bit OS, make sure the msi filename does not have "64-bit" in it.

"Please wait while the installer finishes determining your disk space requirements."

Cleanup/empty the temp-directory (e.g. C:\Users\<your user>\AppData\Local\Temp, C:\User and Settings\<your user>\Local Settings\Temp, c:\Windows\Temp\).

由如上說明,我們尋找要下載的對應安裝包,如下。

二、下載安裝包

1、TortoiseGit下載地址:

http://code.google.com/p/tortoisegit/downloads/list

本次下載版本——TortoiseGit-1.7.12.0-64bit.msi

TortoiseGit 1.7.12.0 64bit 

x64 Featured

2、msysgit下載地址:

http://code.google.com/p/msysgit/downloads/list

本次下載版本——Git-1.7.11-preview20120710.exe

Full installer for official Git for Windows 1.7.11 

Featured Beta

三、安裝過程

安裝順序:首先安裝msysgit;然後安裝TortoiseGit。

1、安裝msysgit。

a、安裝包下載完成後,雙擊進入安裝界面,如下圖:

clip_p_w_picpath001[4]

b、兩步next後選擇安裝目錄,如下圖:

clip_p_w_picpath002[4]

c、next進入Git安裝模塊選擇,默認,如下圖:

clip_p_w_picpath003[4]

d、next進入Git setup界面,“Select start menu folder”,默認,如下圖:

clip_p_w_picpath004[4]

e、next進入Git Setup界面,“Adjusting your PATH environment”,選擇默認值“Use Git Bash only”,如下圖所示:

clip_p_w_picpath005[4]

f、next進入Git Setup界面,“Configuring the line ending conversions”,選擇換行格式,選擇“Checkout as-is, commit Unix-style line endings”,如下圖所示:

clip_p_w_picpath006[4]

g、next進入安裝界面,完成安裝,如下圖所示:

clip_p_w_picpath007[4]

這個時候已經可以使用git了, 打開Git Bash可以進入linux shell,可以使用git命令進行各種操作,由於大家都習慣使用圖形界面的 TortoiseSVN,下面介紹使用 TortoiseSVN的類似軟件 TortoiseGit,使用習慣相同,大家應該比較容易使用。

2、安裝TortoiseGit。

a、雙擊安裝程序,進入安裝界面,如下如所示:

clip_p_w_picpath008[4]

b、兩步next進入“Choose SSH Client”選擇界面,選擇“OpenSSH,Git default SSH Client”,如下圖所示:

clip_p_w_picpath009[4]

c、next進入“Custom Setup”界面,選擇默認值,如下圖所示:

clip_p_w_picpath010[4]

d、next,進入“Ready to Install”界面,選擇“Install”按鈕開始安裝過程,完成安裝。如下圖所示:

clip_p_w_picpath011[4]

e、至此,TortoiseGit安裝完成。在桌面空白處點擊右鍵,右鍵菜單中會加入TortoiseGit快捷鍵,如下圖所示:

clip_p_w_picpath012[4]

f、選擇“Settings”,進入“Settings-TortoiseGit”界面,選擇“General”選項卡,設置本機器的git路徑,如下圖所示:

clip_p_w_picpath014[4]

g、同時選擇“Network”選項卡,設置SSH路徑。SSH默認在安裝Git時就安裝了,在如下圖所示的路徑中。如下圖所示:

clip_p_w_picpath016[4]

h、選擇“Git”選項卡,設置用戶名、郵箱和key。如下圖所示:

clip_p_w_picpath018[4]

注:如果暫時在本地使用就只需將用戶名和郵箱添加,而“Signing key”會自動生成。

至此,TortoiseGit設置完成。

3、下載代碼。

a、桌面空白處右鍵,選擇git clone添加版本庫地址URL和本地文件夾。如下圖所示:

clip_p_w_picpath019[4]

點擊ok即可下載一份新版本庫。

 
 
分類: windows
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章