Branches and remotes

The sidebar lists your branches, the remotes and their branches. From there you create, switch, rename and delete branches, and add, edit, fetch and remove remotes. The toolbar's Push button carries the rest: a plain push, what to do when a push is rejected, and a force push with lease when you have rewritten history on purpose.

Where to find it

  • Sidebar › Branches and Sidebar › Remotes.
  • Repository › New branch… (⌘⇧B), the toolbar's branch button ("Create a branch"), or Command palette › Branches › New branch….
  • Repository › Fetch (⌘⌥F), Pull (⌘⇧↓), Push (⌘⇧↑), Force push with lease… and Remotes….
  • Toolbar › Push › More push options: Push, Force push with lease…, Remotes….
  • History tab: Switch to branch and Check out hash… on a commit's menu. See Commit graph and search.
The sidebar's Remotes section and the toolbar's Fetch, Pull and Push buttons with their counts.

Branches

The Branches section lists local branches with the current one marked. Each row has a Switch button, a More button for its menu, and a trash button, Delete branch. Click a row to select its commit in History; double-click it, or press ⌘⏎ on it, to switch to it. The plus button in the section header is New branch.

Creating a branch

The New branch sheet starts from the current commit: "Starts from branch (hash)."

FieldDetail
NameThe placeholder is "feat/something". Left empty, the error reads "Type a name for the branch."
Switch to the new branchOn by default.
Create branch⏎ in the field does the same.

Toast: "Created name and switched to it." or "Created name."

In a repository with no commits the lead reads "There are no commits yet, so the branch starts empty."

When HEAD is detached

After checking out a commit or a tag you are on a commit, not a branch. The toolbar shows a Detached at hash chip ("HEAD is on a commit, not a branch. Create a branch here to keep commits you make.") and a Create branch here button, which opens the sheet titled "Create branch here" with the lead "You're on hash without a branch. A branch here keeps the commits you make, and switching to it puts you back on a branch." Pull and Push are off until you are on a branch again. Checking out a commit is described on Compare and reset.

Switching and checking out

ActionWhereWhat happens
Switch to branchThe row's Switch button, double-click, the branch menu, the palette, or a commit's menu in History for a local branch on it.Checks the branch out. Toast: "Switched to name."
Check out remote branchThe Check out button on a remote branch in the Remotes section, double-click, its menu, or the palette.Creates a local branch of the same name tracking the remote one and switches to it. Toast: "Created local tracking remote/name and switched to it."

The branch menu

Right-click a branch, or press its More button:

ItemWhat it does
Switch to name, or Check out name for a remote branchAs above.
Merge name into currentMerges. See Rebase, merge, cherry-pick and revert.
Rebase current onto nameRebases.
Interactive rebase onto name…The Interactive rebase sheet.
New worktree for this branch…The New worktree sheet with the branch filled in. See Worktrees and worktree setup.
Show in HistorySelects the branch's commit on the History tab.
Rename name…Local branches only. The Rename sheet, below.
Delete nameLocal branches only. Off for the current branch.

Renaming a branch

Rename name… opens a sheet: "The branch keeps its commits and its upstream, origin/name." Type the new name and press Rename branch. The errors are "Type a new name for the branch." and "name already has that name."

When the branch has an upstream, the sheet also offers Also rename it on origin, with a hint that changes as you tick it: "origin/old becomes origin/new, and origin/old is deleted." or "new keeps tracking origin/old." With it ticked, Mergepond asks "Rename on origin too?" and explains: "Pushes origin/old's commits to origin as new, makes that the upstream of new, then deletes origin/old. Open pull requests from origin/old may close, and anyone else using it needs the new name. This part can't be undone from Mergepond." The answers are Cancel and Rename on origin.

Toasts: "Renamed old to new." or "Renamed old to new, here and on origin." with Undo, which gives the local branch its old name back. The remote part stays done.

Deleting a branch

Delete branch on the row, or Delete name in the menu, deletes a local branch straight away; the toast "Deleted branch name." offers Undo, which recreates it at the same commit. The current branch can't be deleted: switch to another one first. See Committing for how undo works.

Remotes

The Remotes section lists each remote with how many branches it has, a Fetch button, and its branches under it, each with a Check out button. Click the remote's name for its menu; the row's tooltip reads "name. Click for its menu: fetch, edit or remove it." The plus button in the section header is Add remote….

The remote's menu

ItemWhat it does
Fetch nameFetches from this remote only. Toast: "Fetched name."
Fetch name and pruneFetches and removes remote branches that no longer exist on the server. Toast: "Fetched name and removed remote branches that are gone there."
Edit remote…The Remotes sheet, open on this remote.
Copy URLCopies its fetch URL.
Remove name…Asks first, below.

The toolbar's Fetch button and ⌘⌥F fetch every remote.

The Remotes sheet

Repository › Remotes… or Toolbar › Push › More push options › Remotes… opens the sheet: "Where this repository fetches from and pushes to." Each row shows the remote's name, its fetch URL, and "Pushes to url" when the push URL differs, with Fetch, Edit and Remove remote buttons. With none it reads "No remotes yet. Add one to fetch and push." Add remote… opens the form below; Done closes the sheet.

Adding a remote

"A remote is another copy of this repository, usually on a server, to fetch from and push to."

FieldDetail
NameFilled with origin when no remote has that name yet. Letters, numbers, -, . and _, with no spaces.
URLThe placeholder is git@github.com:owner/repo.git. "An https or SSH URL, or a folder path."
Fetch its branches after adding itOn by default.

Add remote adds it; the toast reads "Added remote name." The errors are "Type a name for the remote.", "“x” isn't a valid remote name. Use letters, numbers, - . and _, with no spaces.", "There's already a remote called x. Pick another name." and "Type the remote's URL."

Editing a remote

Edit opens "Edit name": "Renaming moves its remote branches and the branches that track it." The fields are Name, URL and Push URL, whose placeholder is "Same as the URL" and whose hint reads "Leave empty to push where you fetch from." Save writes them; the toast reads "Renamed remote old to new." or "Saved remote name."

Removing a remote

Remove remote in the sheet, or Remove name… in the menu, asks "Remove remote name?": "Mergepond stops fetching from and pushing to name, its N remote branches go, and N branches that track it lose their upstream. Nothing on the server changes. You can undo this." The answers are Cancel, which has focus, and Remove name. The toast "Removed remote name." offers Undo, which adds the remote back with its URLs and gives the branches their upstream again.

Pushing

The toolbar's Push button shows how many commits the branch is ahead of its upstream. Its tooltip reads "Push N to upstream" when the branch tracks a remote branch of the same name.

A branch with no upstream yet, or one that tracks a branch with a different name, reads "Push branch to a branch of the same name and track it". Push creates origin/branch (on the remote the branch tracks, or your default remote) and sets it as the upstream, after which Pull works too. New branches and new worktree branches start with no upstream, even when they start from origin/main, so their first push never goes to main. A worktree made from an existing remote branch tracks that branch. When there is nothing to push the button is off: "Nothing to push. upstream already has every commit on branch." The toast afterwards reads "Pushed N commits to upstream." or "Pushed branch to upstream."

A rejected push

When the server has commits your branch lacks, the push stops and Mergepond asks: "upstream has commits you don't have", "The push was rejected. Pull to bring those commits into branch, then push. If you rewrote branch on purpose, with a rebase or an amend, force push to replace them." The answers are Cancel, Force push… and Pull, which has focus.

Force push with lease

Force push with lease…, in the Repository menu or the push button's More push options menu, replaces the upstream branch with yours, the step after an interactive rebase or an amend of commits you had already pushed. It is off when the branch has no upstream.

The dialog is "Force push branch to upstream?" and lists the commits on the upstream that your branch doesn't have, up to three, with "and N more" for the rest, then: "If anyone pushed since your last fetch, the push stops and nothing is overwritten." When the upstream has nothing you lack it says so instead: "As of your last fetch, upstream has nothing that branch lacks, so a normal push should work." The answers are Cancel and Force push. Toast: "Force pushed branch to upstream."

The lease is what makes it safe to use: Git compares the server's branch with the remote branch from your last fetch, and refuses when they differ. Then Mergepond reports "Couldn't force push. upstream changed since your last fetch, so nothing was overwritten. Fetch, look at what's new, then try again."

Free and Pro

Branches, remotes and force push work the same on Free and Pro. Repositories on SSH hosts need Pro.