git - "git pull --rebase"导致 "Cannot rebase onto multiple branches"

标签 git github branch git-rebase git-pull

所以,我的工作环境恰好有一个分支,在 Github 上有一个远程伴侣。我正在尝试执行 git pull --rebase 以防止 git push 创建 merge 提交消息,这些消息不会向从事该项目的其他人提供新信息,并且把作品搞砸了。但是当我尝试这样做时,它给了我这个:

From https://github.com/our_profile/our_repository
 * branch            HEAD        -> FETCH_HEAD
Cannot rebase onto multiple branches

并且 pull 中止。调用 git branch 通知我本地机器上只有一个分支,这是怎么回事?

最佳答案

尝试准确指定要 pull 的远程分支:

git pull --rebase origin branch

或者,您也可以先从远程存储库git fetch 所有更改,然后手动 rebase :

git rebase origin/branch

关于git - "git pull --rebase"导致 "Cannot rebase onto multiple branches",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9984287/

相关文章:

SVN:跨项目共享通用代码的最佳方式

git - 你如何停止跟踪 Git 中的远程分支?

Git push 对远程的 Google Code repo 没有任何作用

git:将两个分支相互 merge - 这不好吗?

git - 获取按 "some"属性(fork 或 star 的数量)排序的 github 存储库搜索结果

node.js - 使用 Github 个人访问 token 构建 Jenkins npm

mercurial - 更好地分支或创建Mercurial存储库?

c++ - 如何在编译时确定 git 存储库的状态?

Git:取消交互式 rebase

github - 如何接受 GitHub 托管存储库的邀请?