Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git GUI on Windows: merging conflicts

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?

like image 949
Merik Avatar asked Aug 03 '16 22:08

Merik


People also ask

Why do I keep getting merge conflicts?

Often, merge conflicts happen when people make different changes to the same line of the same file, or when one person edits a file and another person deletes the same file. You must resolve all merge conflicts before you can merge a pull request on GitHub.


1 Answers

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.

like image 124
Merik Avatar answered Sep 28 '22 18:09

Merik