开发者

How do I undo "Resolve" in TortoiseGit?

开发者 https://www.devze.com 2023-03-27 02:04 出处:网络
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 - ju

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.

  1. With your feature branch checked out, right click on the log on the commit right before your merge commit(on the feature branch).

  2. Click on "Reset feature_branch to here". In the subsequent window select hard.

  3. 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
0

精彩评论

暂无评论...
验证码 换一张
取 消