本站文章均為【小豬熊】原創,轉載務必在明顯處註明:(作者新浪微博:@周公夢蝶9999)轉載自【小豬熊】 原文連結:www.piggybear.net/?p=280
1、在oschina後臺新建專案

2、填寫專案描敘

3、複製地址(HTTPS或SSH)都可以

4、在SourceTree客戶端,新倉庫–>從URL克隆

5、剛剛才複製的地址貼上到源URL

6、建立rsa檔案
ssh-keygen -f ~/.ssh/test_id_rsa #指定目錄
7、檢視建立好的test_id_rsa.pub
cat ~/.ssh/test_id_rsa
8、把test_id_rsa.pub裡面的資訊新增到oschina後臺公鑰那裡

9、配置.ssh/config檔案(如果你有多個id_rsa,則配置一下,不需要可以忽略)
Host git.oschina.net
HostName git.oschina.net
Port22
User test#你oschina的使用者名稱
IdentityFile ~/.ssh/test_id_rsa#建立的test_id_rsa路徑
10、測試是否配置成功
bogon:.ssh mac_pc$ ssh -T git@git.oschina.net
Welcome to Git@OSC, piggybear!