git push origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read

來源:互聯網
上載者:User

在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/

使用

1 git init

來初始化一個空的git倉庫,現在使用ls-la命令查看目錄下的所有檔案(包含隱藏檔案)

1 total 16
1 2 3 4 5

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.