Skip to content

Merge, rebase and cherry-pick

All three act on the current branch: you pick the other side in the graph, the branch list or the tag list. tt-git asks before it starts each one.

WhereMrC
GraphMerge the selected commit into the current branchRebase the current branch onto the selected commitCherry-pick the selected commit
BranchesMerge the selected branchRebase onto the selected branch
TagsMerge the selected tagRebase onto the selected tag

In the graph, if the selected commit has a branch badge, tt-git uses the branch name rather than the hash, so the merge commit says Merge branch 'feature'. In the branch list it uses your local branch if you have one, and the remote branch otherwise.

The Merge confirmation dialog

Press y or enter to go ahead, n or esc to cancel. When it’s done, the graph moves to the new head.

tt-git runs git merge --no-edit <branch>. A fast-forward just moves the branch; otherwise git makes a merge commit with its default message.

tt-git runs git rebase <onto>, not interactively: every commit of the current branch that isn’t on the target is replayed on top of it. Git’s editor is turned off for the rebase, so it never opens one inside the terminal.

C in the graph applies the selected commit on top of the current branch with git cherry-pick <commit>. The confirm box shows the commit’s hash and subject.

When a merge, rebase or cherry-pick stops on a conflict, the status pane shows what’s going on:

  • The title adds MERGING, REBASING, CHERRY-PICKING or REVERTING.
  • A banner row at the top says what to do next, for example REBASING: stage fixes · C continue · X abort.
  • Conflicted files show UU (or another U code) in the error color.
The status pane during a merge with a conflict: MERGING in the title, the banner, a resolved file and a conflicted one
  1. Open each conflicted file in your editor and fix the conflict markers. e in the status pane opens the selected file at its first one. The selected file’s diff shows in details.

  2. Back in tt-git, press space on the file to stage it. Staging a conflicted file marks it resolved.

  3. When every file is staged, press C to continue.

Conflicted files can’t be staged a hunk at a time; stage the whole file once it’s fixed.

Press C or X in the status pane. From any other pane, open the command palette and pick Continue merge/rebase or Abort merge/rebase. (In the graph, C is cherry-pick.)

  • C continue. tt-git refuses while a file is still conflicted. A merge is finished with git commit --no-edit; a rebase or cherry-pick with git rebase --continue or git cherry-pick --continue. Git’s prepared message is kept and no editor opens. A rebase may stop again on a later commit; resolve and continue the same way.
  • X abort. tt-git asks first, then runs git merge --abort (or rebase, cherry-pick) and puts everything back as it was before you started.