简体   繁体   English

如何“修复” git rerere分辨率

[英]How to “fixup” git rerere resolution

My workflow usually consists of merge -> resolve conflicts -> commit -> debug during compilation -> fixup commit . 我的工作流程通常由merge -> resolve conflicts -> commit -> debug during compilation -> fixup commit In this way I make dirty merge with clearing afterwards. 这样,我就可以进行脏合并,然后再进行清除。 If I enable rerere I would always have dirty resolutions recorded. 如果启用rerere我将始终记录肮脏的分辨率。 How to bypass this problem? 如何绕开这个问题? Is there a way to fix rerere resolution by following commit? 有没有一种方法可以通过遵循提交来解决rerere解析问题?

It is clumsy but what have I did for my last big bad merge. 这很笨拙,但是我为最后一次重大合并做了什么。

At first I have checkout my branch to before merge state in tmp branch. 首先,我将结帐到tmp分支中的合并状态之前。 Then run similar merge. 然后运行类似的合并。 Then do following process: 然后执行以下过程:

for F in `git show $FIXCOMMIT --stat | awk '{print $1}' | tail -n +7 | head -n -1`; do
    git checkout -m $F
    git rerere forget $F
    cp $FIXED/$F ./$F
done

Where FIXCOMMIT is commit with fixes. FIXCOMMIT提交修复的地方。 And FIXED is workingtree with FIXCOMMIT state. FIXED是具有FIXCOMMIT状态的工作树。

As a lesson I think that one shouldn't commit merge before compilation. 作为一个教训,我认为不应在编译之前提交合并。

My workflow typically consist of: 我的工作流程通常包括:

Make changes -> test -> commit -> make more changes -> test -> commit -> repeat. 进行更改->测试->提交->进行更多更改->测试->提交->重复。

This gives me multiple local commits that together comprise what need to be done. 这给了我多个本地提交,它们共同构成了需要完成的工作。 When I feel done I run: 当我感觉完之后,我跑步:

git rebase -i HEAD~[nr_of_commits_i_created]

And I make sure to fixup all but the first one. 而且我确保修复所有问题,除了第一个。 The first one I either keep as it is or reword it one last time. 第一个我要么保持原状,要么最后一次改写。 Now I end up with 1 commit containing all my changes. 现在,我完成了1次提交,其中包含我的所有更改。 I rebase on my master branch, solve any conflicts and push my changes. 我以我的master分支为基础,解决所有冲突并推动我的更改。

This way I never really have to deal with merging. 这样,我就不必真正处理合并。

I realize that this does not directly answer your question. 我意识到这并不能直接回答您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM