【发布时间】:2020-02-22 10:37:38
【问题描述】:
我和我的同事forked 有一个名为main_repo 的存储库。因此,我的同事在她的 fork 上创建了一个名为 new_changes 的分支,并从我的名为 my_branch 的分支中分支出来并进行了新的更改。昨天我使用合并按钮将她的分支请求合并到我的分支。
在她的拉取请求页面上,它在提交 1234 中显示 MERGED her_fork_repo new_changes 到 my_branch。假设如果我在我的 intellij 分支上 git pull 我会看到我同事的新更改,但它却说:
There is no tracking information for the current branch. Please specify which branch you want to rebase against. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> my_branch
当我输入git remote 时,从我的分支显示origin。我也尝试过git pull origin my_branch,但git 显示Already up to date。
从my_branch 的拉取请求页面(合并到main_repo),我也没有看到新的更改,我应该怎么做才能使新的更改反映在我的分支上?
【问题讨论】:
-
当你说“我和我的同事分叉”时,你的意思是你和你的同事是一个分叉还是两个各自的分叉? “我将她分支的拉取请求合并到我的分支”,你的意思是拉取请求被合并到她的分叉上吗?
-
你能分享你在运行
git remote -v时看到的内容吗? -
“我和我的同事分叉”意味着我和我的同事分别有 2 个分叉“我将她的分支的拉取请求合并到我的分支”意味着 PR 已合并到我的分叉,但那是我的错误,它实际上已合并到 main_repo 当我运行 git remote -v 我看到 origin link-to-my-fork-repo (fetch) origin link-to-my-fork-repo (push) 无论如何问题现在解决了,谢谢!