I have merged two branches in a local Git repository, with a bunch of conflicts. Thinking that "Resolve" in the TortoiseGit context menu would take me to a conflict resolution GUI, I clicked it - just to realize I just marked all conflicts as resolved without doing anything about them. Thus I have a bunch of unmarked files with:
master<<<<<<<<<
some change
=======
some other change
>>>>>>>>>>branch
constructs in them, and Git doesn't know they're still a problem.
How do I undo this marking of conflicts as resolved, i.e., mark them as co开发者_开发问答nflicts again?
I don't use tortoise git, but you should be able to just hard reset back to before the merge and re-merge. Since you didn't do anything with the conflicts, the re-merge will give you the same output.
I just tested this.
With your feature branch checked out, right click on the log on the commit right before your merge commit(on the feature branch).
Click on "Reset feature_branch to here". In the subsequent window select hard.
Your merge is now undone, merge it back in and it should give you the same conflict markers, but you will need to resolve them.
On the Git command line you have to use git checkout
with the -m
/--merge
flag or the --conflict=<style>
option:
git checkout --conflict=merge -- path/to/file
精彩评论