冲突解决期间隐藏更改 [英] Stash changes during conflict resolution
问题描述
我使用 git cherry-pick
将一个复杂功能重新绑定到另一个分支。当试图解决大型提交中的冲突时,我发现我错过了一些应该首先应用的其他提交。
我不能存储
当前状态,应用另一个提交,然后执行存储pop
。
我可以执行 cherry-pick --abort
,应用其他提交,然后重新挑选它,但是我将失去已解决的冲突。
处理这种情况的最好方法是什么? 解决方案
关注 j6t 建议,你可以完成然后倒带,应用其他提交和樱桃选择再次。
这个想法是确保 git rerere
处于活动状态以避免解析再次合并冲突。
如果您未激活 rerere
,您有我之前提到的rerere-train.sh脚本,以便不会忘记您的第一轮合并的冲突解决方案。
I am rebasing a complex feature to another branch using git cherry-pick
. When trying to resolve conflicts in a big commit, I find out that I've missed some other commit that should be applied first.
I can't stash
the current state, apply the other commit and then do stash pop
.
I could do cherry-pick --abort
, apply the other commit and then cherry-pick it again, but I would lose those resolved conflicts.
What is the best way to deal with such situation?
Following j6t advice, you can complete then rewind, apply the other commits and cherry-pick again.
The idea is to make sure git rerere
is active in order to avoid resolving the merge conflicts all over again.
If you did not activated rerere
, you have the rerere-train.sh script I mentioned before, in order to not forget your conflict resolution of your first round of merges.
这篇关于冲突解决期间隐藏更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!