[英]Repo not found fatal error while using git and unable to push to github
我已經檢查了很多 stackoverflow 試圖弄清楚為什么我會收到這個錯誤,因為我在 github 上確實有一個我想要推送的內容的倉庫。 我什至重新生成了我的 ssh 密鑰並將其添加到 github。 我還看到:
Please make sure you have the correct access rights
並且存儲庫存在。
當我嘗試遠程添加 repo 時,我看到:
$ git remote add origin git@github.com:<username>/<reponame>.git
> fatal: remote origin already exists.
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
然后我得到錯誤
當我嘗試
ssh -T git@github.com
我看到正確的用戶名
不知道還有什么可以嘗試的。
如果您已經輸入
$ git remote add origin git@github.com:<username>/<reponame>.git
你不能再次輸入它,因為 origin 現在已經存在。 它會回應
致命:遠程源已經存在。
但是鏈接到原點的地址可能是錯誤的。 嘗試打字
$ git remote remove origin
並輸入
$ git remote add origin git@github.com:<username>/<reponame>.git
再次。
然后輸入
$ git push origin master
如果地址和 SSH 密鑰都正確,它可能會起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.