Skip to content
GitTree
Merge and resolve

Merge branches

Merging brings the commits of another branch into the branch you are on, like git merge. Right-click the other branch and choose Merge … into …: GitTree checks for conflicts first and lets you choose how the merge is recorded.

FreeUpdated

Works in GitTree Free: every local Git feature, once you are signed in.

On this page
  1. Before you start
  2. Where to find it
  3. Steps
  4. Expected result
  5. Ways to record a merge
  6. If something goes wrong
  7. Questions
  8. Related

Before you start

Where to find it

  • Right-click a branch label: Merge feature/search into develop.
  • Drag one branch label onto another, then choose the merge.
  • More options: More Ways to Integrate in the same menu.
ActionmacOSWindows and Linux
Undo a merge⌘ZCtrl+Z

Steps

  1. Choose the branch to merge

    Right-click the label of the branch that holds the new work and choose Merge … into …, with your current branch as the second name.

  2. Read the preview

    The dialog says what it brings in and checks for conflicts: Merges without conflicts. or which files will stop with a conflict.

    The GitTree dialog to merge feature/search into develop, with the ways to record the merge and the Merge button numbered
    1 how the merge is recorded, 2 the button that merges.GitTree interface with a demonstration repository.
  3. Choose how it is recorded

    Under Record it as, pick one of the options in the table below. The first one suits most merges.

  4. Merge

    Press Merge. Cancel is the default, so nothing happens until you choose.

Expected result

Your branch now contains the other branch’s commits: either moved forward to them, or joined with a merge commit that has two parents.

Ways to record a merge

The options under Record it as
OptionWhat you get
Fast-forward if possible, else a merge commitIf your branch has nothing new, it simply moves forward; otherwise a merge commit joins the two.
Always a merge commitA merge commit even when a fast-forward was possible (--no-ff), so the branch stays visible in the history.
Fast-forward onlyOnly moves forward; refuses if the branches have diverged.
Squash into staged changes (no commit)All the changes, staged as one; you write the commit yourself.

If something goes wrong

The merge stopped with conflicts

The banner says Merging … into … with the number of conflicts. Select Resolve and settle each file, then Continue, or Abort… to go back (resolve merge conflicts).

Questions

Merge or rebase?

Merging keeps history exactly as it happened, with a merge commit. Rebasing replays your commits on top of the other branch for a straight line, but rewrites them (rebase). On shared branches, merging is the safer choice.