【问题标题】:Github: Remote does not appear to be a git repositoryGithub:Remote 似乎不是 git 存储库
【发布时间】:2021-07-28 15:33:51
【问题描述】:

我在 Github 抛出错误时遇到了一些问题:致命:'remote' 似乎不是 git 存储库。

我做了克隆,成功了。

git clone https://github.com/StephenW789/CIS-41B-Final-Project-Public

cd CIS-41B-Final-Project-Public

git remote -v # Prints out the correct origin as expected

然后我这样做了,最终得到了错误消息

git fetch remote main
fatal: 'remote' 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.

我尝试了以下方法,但问题仍然存在。

git remote remove origin
git remote add https://github.com/StephenW789/CIS-41B-Final-Project-Public
git fetch remote main

谢谢。

【问题讨论】:

  • 试试https://github.com/StephenW789/CIS-41B-Final-Project-Public.git,你不应该使用你的存储库的网页展示的url,你应该使用github提供的克隆url。如您所见,该网址在某些情况下有效,但并非全部有效。

标签: git github git-fetch


【解决方案1】:

这是因为remote 不是遥控器的名称:origin 是遥控器的名称。那就是:你想要git fetch origin,而不是git fetch remote

我和 Lasse V. Karlsen 和你自己一样,在最初的几次通读中都错过了这一点。很容易将“remote”读作遥控器的正确名称。 :-)

【讨论】:

  • 你说得对,我完全错过了:)
猜你喜欢
  • 2017-01-26
  • 2013-08-26
  • 1970-01-01
  • 1970-01-01
  • 2011-11-11
  • 2015-07-01
  • 2015-12-30
  • 2020-09-14
  • 2013-03-04
相关资源
最近更新 更多