在Xcode中push好久都沒有反應,然後就給停止了
子啊終端中嘗試進行push,結果還是出現錯誤:
git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
結果檢查到:Remotes居然被我修改了,預設是origin 現在變成testFlight 果斷會報錯 。
修正即可:
git status
On branch master
nothing to commit, working directory clean
bogon:testFlight ycf$ git push testFlight master
Counting objects: 35, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (30/30), done.
Writing objects: 100% (35/35), 10.76 KiB | 0 bytes/s, done.
Total 35 (delta 5), reused 0 (delta 0)
To https://github.com/matiji66/testFlight.git
aa09f31..a5cee9e master -> master
bogon:testFlight ycf$
附上使用Xcode上傳代碼至GitHub:
開始
首先我們建立一個工程,記得要勾選Create git repository on:
這說明使用Source Control,會預設在工程中建立git repository。然後工程建立完成後,會在右側邊欄看到這些資訊,說明已經啟用Source Control
如果沒有使用Source Control,則是這樣的:
現在我們已經在工程中啟用了Source Control,這樣就可以使用git來管理工程版本了
但是如果我們想對一個未啟用git的工程加入git的功能怎麼做呢。我們可以使用命令列來開啟此功能,建立一個工程,不勾選Create git repository on,此時我們沒有開啟Source Control,然後我們手動建立git管理,如下圖所示:
| 1 2 3 |
YiBantekiiMac-3:UseGit YiBan$ cd /Users/YiBan/Documents/iOS_Dev/ManualGitDemo YiBantekiiMac-3:ManualGitDemo YiBan$ git init Initialized empty Git repository in /Users/YiBan/Documents/iOS_Dev/ManualGitDemo/.git/ |
使用
來初始化一個空的git倉庫,現在使用ls-la命令查看目錄下的所有檔案(包含隱藏檔案)