[英]git: rebase (after merge) gives only conflicts
I have the following situation 我有以下情况
At some point I want to merge my work from 'dev' into master 在某些时候,我想将我的工作从'dev'合并到master中
$> git checkout master
$> git merge dev
Thats no problem, but now I would like to continue working in branch 'dev'. 这没问题,但现在我想继续在分支'dev'工作。 However, 'master' has some commits which are not yet in 'dev', so I tried to rebase.
但是,'master'有一些尚未进入'dev'的提交,所以我试图改变。
$> git checkout dev
$> git rebase master
This doesn't work and only gives conflicts. 这不起作用,只会产生冲突。 Solving the conflicts doesn't work, because after that there are more conflicts.
解决冲突是行不通的,因为之后会有更多的冲突。 Is there an explanation for this ?
对此有解释吗?
It is a little bit unclear what you want to achieve. 你想要实现的目标有点不清楚。 At the beginning you wrote:
一开始你写道:
At some point I want to merge my work from 'dev' into master
在某些时候,我想将我的工作从'dev'合并到master中
Then you wrote: 然后你写道:
However, 'master' has some commits which are not yet in 'dev', so I tried to rebase.
但是,'master'有一些尚未进入'dev'的提交,所以我试图改变。
If you want to get the work from dev
into master
you should 如果你想让
dev
的工作变成master
你应该
git checkout master
git rebase dev
git rebase --continue
Then you can go back to dev
branch with git checkout dev
然后你可以使用
git checkout dev
返回dev
分支
If you want to do it the other way, just switch the names I personally think that running git rebase --continue
is the key to your problem. 如果你想以另一种方式做,只需切换名称我个人认为运行
git rebase --continue
是你问题的关键。
PS: Instead of rebasing, try to consider running a git merge
in this case. PS:在这种情况下,尝试考虑运行
git merge
,而不是重新定位。
The only reasonable way to get the changes from master back into dev after you have merged dev into master is by merging master into dev, not rebasing dev on top of master. 在将dev合并到master之后, 将 master从master更改回dev的唯一合理方法是将 master 合并到dev中,而不是在master上重新设置dev。
Rebasing is usually only used on branches that haven't been merged into anything yet. 重新定位通常仅用于尚未合并到任何内容的分支上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.