Git GUI on Windows: merging conflicts

Merik picture Merik · Aug 4, 2016 · Viewed 29.5k times · Source

I am fluent with Git on the command line but for a specific project, I need to show others how to do things exclusively in the GUI environment. We are using Git for Windows (available at https://git-scm.com/download/win).

I created a file and added to the repository. Then had another user modify the file and push it. I also modified the file, then I fetched the repository from origin, and used "Merge > Local Merge" menu to show how Git GUI finds the conflicts.

Then I manually edited the text file and resolved the conflict by cherry-picking some of my changes and some of those by the other user. At this stage, if it was command line I would do git add. In the GUI you are supposed to do the same thing using the "Stage Changed" button, I presume, but when I press the button it doesn't actually stage the changed file.

I cannot find any online documentation for the GUI program that discusses merge conflict resolution. Can anyone please tell me what the next step would be in the GUI environment?

Answer

Merik picture Merik · Aug 4, 2016

I found the answer. As annoying as it is, when you are doing anything other than conflict resolution, the Stage Changed button does what the git add command would do. But if you are resolving conflicts, you should not use that button (it actually doesn't work); instead you should use the following menu: Commit > Stage To Commit. The keyboard shortcut is CTRL+T.

In fact the Stage Changed button is equivalent to the menu option Commit > Stage Changed Files to Commit.