GIT環境搭建

來源:互聯網
上載者:User

1、 Git,Windows下的Git,地址:http://msysgit.googlecode.com/files/Git-1.7.9-preview20120201.exe(方便下載)

2 、SSH,可以用CopSSH,地址:http://sqmcc2.newhua.com/down/Copssh_4.1.0_Installer.zip(方便下載)

3、git、CopSSH安裝可以參照(注意:看圖片就好了其它的無視):http://www.codeproject.com/Articles/296398/Step-by-Step-Setup-Git-Server-on-Windows-with-CopS

強調下:在安裝CopSSH是需要建立使用者,這裡建立的使用者是git,所以下面的地址才可能是git@127.0.0.1

4、配置(windows系統的)git環境變數,在Path後面追加(複製下面代碼改下git的安裝路徑就可以了)

;D:\Program Files\Git\bin;D:\Program Files\Git\libexec\git-core;

5、配置copssh的(檔案在安裝目錄下的etc檔案夾裡)profile(複製下面代碼改下git的安裝路徑就可以了)

gitpath=`/bin/cygpath D:/Program\ Files/Git/bin` #這裡不是引號,路徑是Git下的cmd,斜杠也要用Unix的習慣
gitlibpath=`/bin/cygpath D:/Program\ Files/Git/libexec/git-core`
export PATH="$PATH:$gitpath:$gitlibpath"

6、測試

開啟git bash 登陸ssh git@127.0.0.1

例如建立一個測試庫(按順序輸入):
mkdir test
cd test
git init
touch a b c d
git add .
git commit -m "init"

然後,就可以在遠程clone這個庫(test)了。clone命令如下:

git clone git@192.168.1.103:testgit aa

到此git windows下搭建環境完成。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.