Branch and merge
Start a branch for a piece of work, switch between branches, and merge the work back when it is done.
What a branch is
A branch is a name that points at a commit. When you commit, the branch you are on moves forward to the new commit. Working on a separate branch keeps unfinished work away from the main line until you merge it, which combines the two histories.
Checking out a branch means switching to it: Git updates the files in your folder to match that branch.
The Branches list
The Branches section of the sidebar lists your local branches. The branch you are on is highlighted, and its name also shows in the header.
Next to a branch you may see:
- Up and down counts: how many commits the branch is ahead of (has, but the server does not) and behind (the server has, but you do not) its upstream branch.
- A gone label: the upstream branch this one tracked was deleted on the server.
Create a branch
Check out the branch you want to start from, so that it is the current branch.
Select the plus button on the Branches heading (Create branch).
Type a name in Branch name.
Leave Check out ticked to switch to the new branch straight away. Untick it to create the branch and stay where you are.
Select Create.
The new branch starts at the commit you are on.
Switch to a branch
Double-click a branch in the Branches list. Or right-click it and choose Checkout.
To start working on a branch that exists only on the server, open the remote under Remotes, find the branch, and select Checkout as local branch. BranchPilot creates a local branch that tracks the remote one. If the list says no branches fetched, fetch first.
Good to know
Git refuses to switch branches when that would overwrite uncommitted edits. Commit them, or stash them, then switch.
Rename or delete a branch
Right-click a branch for its menu:
| Item | What it does |
|---|---|
| Checkout | Switches to the branch. |
| Merge into current… | Merges this branch into the branch you are on. |
| Rename… | Gives the branch a new name. |
| Delete… | Deletes the local branch. |
Merge into current… and Delete… are unavailable for the branch you are on.
Deleting asks for confirmation and warns This cannot be undone. If the branch has commits that were never merged, BranchPilot stops and shows Branch not fully merged. Choose Force delete only if you are sure you no longer need those commits.
WARNING
Force-deleting an unmerged branch removes the only name that points at its commits. They become hard to find and Git eventually discards them.
Deleting a local branch does not delete the branch on the server.
Merge a branch
Check out the branch that should receive the changes, for example
main.Right-click the branch you want to bring in and choose Merge into current….
Confirm with Merge.
If the two branches changed different things, the merge finishes by itself and the graph shows the result. When the current branch has no new commits of its own, Git moves it forward to the other branch without creating a merge commit (a fast-forward).
If both branches changed the same lines, BranchPilot reports Merge has conflicts — resolve them in the right panel and a Merge in progress banner appears. Continue with Resolve conflicts.
Read the commit graph
- Each dot is a commit. A hollow ring is a merge commit, where two lines join.
- Each branch keeps its own lane and colour.
- Labels on a row show which branches, tags and remote branches point at that commit.
- Select a row to open the commit's details. Right-click a row for actions such as Copy hash, Create tag here… and Interactive rebase onto this commit….