Git 错误 : 'upstream' does not appear to be a git repository

标签 git github

我是 Git 的新手,所以在正确使用它时遇到了一些问题。 这是我的场景。

我有一个我的主存储库的分支,并将其克隆到我的本地。 在那里,我有 2 个分支用于不同的修复。

当我提交时,我在 git 中看到一条声明 - 我们说我提前 3 次提交,落后大约 20 次提交。

我知道我的 fork 与 master 不同步。我也需要 merge 这两个分支(或者我应该这样做吗?)

我用windows客户端来同步。但似乎我没有遵循 Git 的方式。因此,我尝试按照 https://help.github.com/articles/syncing-a-fork/ 中描述的步骤进行操作这给我一个错误如下(我使用的是 Windows)。

 $>git fetch upstream
 fatal: 'upstream' 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.

我有点困惑。 请帮助我了解在这种情况下应遵循的步骤。

@HuStmpHrrr

很抱歉在评论中添加详细信息 我将修改问题以提高可读性

通过执行命令:

  $>git remote  returning two values
  acme-development (which the name of my actual/main repository, from where I forked) and
  origin

添加更多信息。


获取后,我尝试将 origin/master merge 到我的 master 请看截图 enter image description here

但是,如果我登录到我的 Github 在线帐户,它会说一个不同的故事。

enter image description here

我的 git 客户端说本地存储库是最新的。 但是在线 git 说我们落后 42 次提交,提前 7 次提交。

最佳答案

您链接到的文章(尽管自您询问以来它可能已经更改)以对 https://help.github.com/articles/configuring-a-remote-for-a-fork/ 的引用开头.如果完成此操作,您将拥有一个名为 upstream 的新远程存储库,它指向您 fork 的原始存储库,并且 git fetch upstream 将起作用。

关于Git 错误 : 'upstream' does not appear to be a git repository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32912359/

相关文章:

windows - 为什么在 checkout git 远程分支窗口时得到 "cannot create directory"?

git - git:获取提交ID和提交说明

git - ORIG_HEAD、FETCH_HEAD、MERGE_HEAD 等

github - github搜索限制结果

java - 将单个 jar(依赖项)添加到共享 Eclipse 项目

git - 如何从另一个分支中获取一个文件,但当前分支中不存在该文件?

Github 推送错误 : RPC failed; result=22, HTTP 代码 = 413

git - Venv、Pycharm、GIT 和 Github

git rebase 不工作

Git:重置 git 配置文件的最简单方法