簡單介紹一個如果在xp下通過git客戶端連接到git@osc。
1、下載從google code下載最新的git客戶端。安裝結束後,啟動git bash。
2、cd切換目錄到自定義的路徑下,我這裡在f盤創建一個git目錄。
3、登錄開源中國git@osc ,沒有的注冊一個帳號。創建新項目過程不再多說了。
4、新建完項目,有兩種連接方式。先使用http方式。在你的bash shell中通過鍵入當前的bash shell不允許輸入中文,可以通過insert鍵粘貼信息。
git clone "http url"
將空的項目克隆到本地。期間要求輸入用戶名和密碼,是注冊時候的郵箱和密碼。能看到在下載文件。如下圖證明更新完成了。

cd到下載目錄中。通過git remote -v可以查看遠程服務器地址。

git status查看文件狀態。

紅色表示是新的文件,沒有被git托管。
git add test.txt或者git add .表示添加文件。“.”表示添加當前目錄所有文件。重新使用gitstatus查看文件狀態,會發現新的文件編程了綠色。表明已經被git管理。

git commit提交文件,可以在git commit -m "注釋"

git push origin master origin表示服務器端的分支名稱,master表示本地分支名稱,如果沒有特殊執行,默認就是這樣。可以通過git branch 查看本地分支名稱。
git branch

如果是通過ssh方式提交,首先要設置公鑰。方法如下:
1、在shell中執行ssh-keygen -t rsa -C "
[email protected]"。給你的文件起個名字,id_rsa

2、回車,輸入密碼

3、然後在上一級目錄能夠看到如下兩個文件。將他們復制到C:\Documents and Settings\Administrator\.ssh\ 目 錄下。

4、在git@osc中找到個人設置-->ssh公鑰設置,添加公鑰。打開id_ras.pub,將全部內容復制,保存。
5、git clone “ssh url”

其他操作同上。