Git:不能重定位到多个分支 [英] Git: Cannot rebase onto multiple branches
问题描述
当我试图拉取和重新绑定 single 分支时,git与无法重新绑定到多个分支。
我浏览过现有的问题,并且他们都建议指定分支以避免错误。在我的情况下,它仍然失败:
$ git pull --rebase origin master
来自github.com:xxx/ yyy
*分支大师 - > FETCH_HEAD
无法重定位到多个分支
运行该命令2-3次有助于
我的git配置:
[color]
ui = true
[core]
pager = less -r
autocrlf = input
excludesfile = /Users/kir/.gitignore_global
editor = / usr / bin / vim
[push]
default = simple
[filterlfs]
clean = git-lfs clean%f $ b $ smudge = git-lfs smudge%f
required = true
Git版本:2.7.2(Brew的最新版本)
尝试在命令末尾设置rebase作为第一个标记:
git pull origin branch --rebase
<如果这仍然没有工作将其分成2个命令( pull = fetch + merge
)。
#fetch所有的远程数据
git fetch --all --prune
#不执行合并命令
git合并origin / branch --rebase
When I'm trying to pull and rebase single branch, git is failing with Cannot rebase onto multiple branches
.
I've browsed existing questions and all of them suggest specifying the branch to avoid the error. In my case it's still failing:
$ git pull --rebase origin master
From github.com:xxx/yyy
* branch master -> FETCH_HEAD
Cannot rebase onto multiple branches
Running the command for 2-3 times helps and the repository gets pulled.
My git config:
[color]
ui = true
[core]
pager = less -r
autocrlf = input
excludesfile = /Users/kir/.gitignore_global
editor = /usr/bin/vim
[push]
default = simple
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
Git version: 2.7.2 (latest from Brew)
Try to set the rebase at the end of the command instead as the first flag:
git pull origin branch --rebase
If this is still doesnt work split it into 2 commands (pull = fetch + merge
).
# fetch all the remote data
git fetch --all --prune
# no execute a merge command
git merge origin/branch --rebase
这篇关于Git:不能重定位到多个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!