Search code examples
gitgit-mergegit-merge-conflict

I want my coworker's git merge conflict markers to show up on my computer


Summary: I want the git conflict markers to show up on my computer so that I can resolve the conflicts in a text file. How can I do that?

Situation: I write a text file.
I check in the text file.
My coworker makes changes to the text file.
I make significant changes to the text file.
I check in the text file*.
My coworker attempts to check in her version of the file.
My coworker gets merge conflicts.

Both my coworker and I agree that it would be best if I went through the text file with the conflict markers and resolved the conflicts on my computer. I have searched, but have not found a way to convince git to give me a copy of the file with the conflict markers in it (ie., get git into a state where I can see and resolve the conflict). What steps would you take to make this happen?


Solution

  • Have your coworker commit his changes to his local HEAD (without your commit), then push to a new branch in your shared remote repo.

    You can then pull from that branch to your local HEAD (with your commit) and you'll get the same merge conflict.