Skip to content

Branch, merge, rebase

  • ⌘B or the toolbar’s Branch button creates a branch at the commit you chose.
  • Double-click a branch in the left panel, or its label in the graph, to check it out.
  • Right-click a branch to rename, delete, hide or solo it.

If your changes are in the way of a checkout, MyTwig asks whether to stash them and bring them along, or discard them. Settings → Git → Changes in the way can decide for you.

Double-clicking a remote branch checks out a local branch that tracks it. If you already have one that is only behind, it’s fast-forwarded. If your local branch has its own commits, MyTwig offers to rebase them, reset to the remote, or check it out as it is. It never drops your commits without asking.

Branches are grouped in folders by the slashes in their names (feature/login). Sort them by name, latest commit or creation date from the button on the Local and Remote titles. Settings → Graph → Branches lists them flat instead.

Drag a branch, from the left panel or its label in the graph, and drop it:

  • onto another branch: a menu offers Merge and Rebase;
  • onto a commit: rebase there;
  • onto a remote branch: push your branch and open a new pull request with that remote branch as its base. Dropping a remote branch opens a pull request from it as it is.

Before you choose, the menu tells you what will happen: “no conflicts”, “conflicts in 2 files”, or what a rebase “may conflict in”. MyTwig works this out with git merge-tree without touching your working tree.

The same actions are in a branch’s right-click menu.

A branch’s Merge Options offer:

  • fast-forward when possible, or a merge commit as your merge.ff says;
  • always a merge commit;
  • squash into staged changes, ready to commit with one message;
  • stop before the merge commit, to look first.

Rebasing a branch that other branches are stacked on can take them along (--update-refs, Git 2.38+).

In the background, MyTwig checks whether your branch would conflict with its upstream and with the remote’s default branch. When it would, “Conflicts with origin/main in 3 files” shows at the top of the working tree panel, and a warning sits beside the branch. Click to see which files. See Resolving conflicts.

  • Interactive rebase: from a commit’s menu or the palette. Pick, reword, squash, fix up or drop each commit, and drag to reorder.
  • Squash or move commits: pick several commits (⌘-click, ⇧-click), drag them onto another commit of your branch, and choose to squash them into it or move them above it.
  • A commit’s menu: cherry-pick, revert, reset the branch to it (soft, mixed or hard), create a tag, copy its SHA or message.

All of these can be undone. See Undo anything.

A worktree is a second checkout of the same repository, so you can work on two branches at once. The toolbar’s worktree button opens an existing one or makes one for a branch.

With two or more open, their tabs appear in a strip under the title bar. Click one to switch the repository’s tab to it. Right-click to remove it, or open it in an editor, a terminal or the file manager. The left panel’s Worktrees section lists them all.

If you use git-flow, MyTwig reads its config. Set it up, then start and finish features, releases and hotfixes from the left panel or the palette.

Create a tag from a commit’s menu. Tags can be pushed, and deleted locally or on the remote, from the left panel.