【问题标题】:GitHub: fatal: 'origin' does not appear to be a git repositoryGitHub:致命:'origin' 似乎不是 git 存储库
【发布时间】:2020-06-10 04:15:17
【问题描述】:

黄色, 我已尝试按照以下步骤设置“无需用户名和密码访问(推送)Github”选项... https://medium.com/@amanze.ogbonna/accessing-pushing-to-github-without-username-and-password-3022feb077fb

但现在我得到一个我似乎无法摆脱的错误:

ficho@ficho-PS63-Modern-8M:~/Desktop/FUTSAL CUP 2020/www$ git push
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.

ficho@ficho-PS63-Modern-8M:~/Desktop/FUTSAL CUP 2020/www$ git remote -v
github  https://github.com/FilipZafran/FutsalCup.git (fetch)
github  https://github.com/FilipZafran/FutsalCup.git (push)
origin  origin (fetch)
origin  origin (push)

我使用的是 Ubuntu 18.4。

这是 Github 存储库: https://github.com/FilipZafran/FutsalCup

不知道我搞砸了什么......

【问题讨论】:

标签: git github ssh ssh-keys


【解决方案1】:
  • origin 是远程存储库的常规默认名称。这意味着运行 git push 将尝试将提交推送到源存储库。
  • 查看您的遥控器列表。您已经定义了名为 github 的存储库,而 origin 没有定义正确的 url。
  • 要解决此问题,我将删除所有遥控器并重新正确添加:
git remote remove origin
git remote remove github
git remote add origin git@github.com:FilipZafran/FutsalCup.git

【讨论】:

  • 嗨,Bug Hunter,感谢您的回复。我按照您的指示进行操作,但随后我再次尝试推送,但出现了新错误:
  • ficho@ficho-PS63-Modern-8M:~/Desktop/FUTSAL CUP 2020/www$ git push fatal:当前分支master没有上游分支。要推送当前分支并将远程设置为上游,请使用 git push --set-upstream origin master
  • ficho@ficho-PS63-Modern-8M:~/Desktop/FUTSAL CUP 2020/www$ git push origin mastergit@github.com:权限被拒绝(公钥)。致命:无法从远程存储库中读取。请确保您拥有正确的访问权限并且存储库存在。
  • ficho@ficho-PS63-Modern-8M:~/Desktop/FUTSAL CUP 2020/www$ git push --set-upstream origin master git@github.com: 权限被拒绝(公钥)。致命:无法从远程存储库中读取。请确保您拥有正确的访问权限并且存储库存在。
  • 您是否正确设置了 SSH?见:help.github.com/en/github/authenticating-to-github/…
猜你喜欢
  • 2023-04-05
  • 2011-11-11
  • 2015-07-01
  • 2020-01-20
  • 2012-06-09
  • 2015-11-21
  • 1970-01-01
  • 2020-06-30
  • 1970-01-01
相关资源
最近更新 更多