1. 首先新建Xcode項目, 并勾選git管理
勾選
2. 通過終端, cd到你的項目下
3. 加入你在遠程倉庫, 新建了一個倉庫, 地址是https://github.com/userName/repoName
4. 在終端下: 添加一個遠程倉庫地址, git remote add repoName https://github.com/userName/repoName
5. git pull --rebase repoName master
6. git push repoName master
之后就遠程倉庫就有你的項目了. 但此時git pull --rebase卻提示fatal: No remote repository specified.Please, specify either a URL or a remote name from which new revisions should be fetched.
搞了好久, 好像很.git/config有關(guān). 手足無措=.=
此時你可以把本地工程刪除, 再git clone https://github.com/userName/repoName
就完美解決了. 可以隨時git pull , git push. 不用再加repoName了=.=