Skip to main content
Back to Blog
How to review Git changes and resolve merge conflicts on a Mac
Blog

How to review Git changes and resolve merge conflicts on a Mac

Inspect a local repository in MadoHub 1.3.0, find paths Git still considers unmerged, and check exactly which changes are staged for your next commit.

When a merge conflict involves a file both branches edited, saving the combined code fixes the file on disk. Git records the resolution when you stage that file. The example below follows a parser through both steps and checks whether its new test fixture will make it into the commit.

The sidebar steps below use version 1.3.0. You can follow the conflict example in a terminal with Git and a text editor.

Open the diff for the right repository

  1. In MadoHub for Mac 1.3.0, press ⌘⇧P, choose Open Project / Frame…, and open the local repository.
  2. Focus a local tile inside that frame. Open the palette again and choose Show Changes for the project. Check the project name if two repositories are open.
  3. Open a file in the sidebar. If the source switch is visible, choose Workspace. This view compares the working tree with HEAD and also lists untracked files.
The workspace panel shows src/parser.ts as Conflict and highlights the combined trim and lowercase change.
The code already does both transformations. The file still carries the Conflict label until the resolution is staged.

Check why Git still marks a file as conflicted

Suppose two branches edit the same line of src/parser.ts. One trims whitespace from a label and the other converts it to lowercase. A test case expects normalize(" BLUE ") to return "blue". Keeping either side alone would fail that case. Here is the conflict in the editor:

<<<<<<< HEAD
  return s.trim();
=======
  return s.toLowerCase();
>>>>>>> lowercase

Replace the marked block with return s.trim().toLowerCase();, save the file and run the test. Now run git status --short from the repository root. In this example, parser-cases.txt is a new test fixture:

UU src/parser.ts
?? parser-cases.txt

UU means both sides modified the file and Git still records a conflict. ?? marks a file Git has never tracked. The test can pass at this point while MadoHub still shows Conflict. To list just the unresolved paths, run:

git diff --name-only --diff-filter=U

Once you have reviewed the combined behavior, run git add -- src/parser.ts to stage the resolution. Use the path of the file you actually resolved. Run the command above again and choose Refresh in MadoHub. In this example the command prints nothing, and git status --short now shows:

M  src/parser.ts
?? parser-cases.txt

Read what the next commit will contain

The M in the first column means the resolution is staged. The ?? line tells you the fixture is still outside the commit. Read git diff --cached to check the staged patch. If the change depends on the fixture, review that file and stage it too. Git diff reference · Git status reference.

Save these review steps as a workspace template.