Stashes, tags and other tools
The smaller jobs: put unfinished work aside, mark a release, copy or undo a commit, move a branch, and work on two branches at once.
Stash work in progress
A stash puts your uncommitted changes on a shelf and gives you a clean working tree. Use it when you need to switch branches or pull but are not ready to commit.
Select the plus button on the Stashes heading in the sidebar (Stash changes).
Optionally type a note in Message (optional) so you recognise the stash later.
Leave Include untracked ticked to shelve new files too.
Select Stash.
Each stash in the list has a menu (Stash actions):
| Item | What it does |
|---|---|
| Show diff | Shows what the stash contains. |
| Apply | Puts the changes back and keeps the stash in the list. |
| Pop | Puts the changes back and removes the stash from the list. |
| Drop… | Deletes the stash without applying it. |
WARNING
Drop… permanently deletes the stashed changes. BranchPilot asks you to confirm first.
Tag a commit
A tag is a permanent name for one commit, typically a release such as v1.2.0.
Right-click the commit in the graph and choose Create tag here….
Type the Tag name.
To make an annotated tag, which records who tagged and when, type a Message (optional). Leave it empty for a lightweight tag, which is only a name.
Select Create.
Tags are listed under Tags in the sidebar and as labels in the graph. The menu on a tag (Tag actions) has Push to remote, which uploads that tag, and Delete…, which deletes the local tag after a confirmation.
Copy a commit hash
Right-click a commit and choose Copy hash. The full hash goes to the clipboard.
Cherry-pick a commit
Cherry-picking copies the changes of one commit onto the branch you are on, as a new commit. Use it to bring a single fix across without merging a whole branch.
Right-click the commit and choose Cherry-pick this commit.
Revert a commit
Reverting adds a new commit that undoes the changes of an earlier one. History is not rewritten, so it is the safe way to undo something you already pushed.
Right-click the commit and choose Revert this commit.
If a cherry-pick or revert conflicts with your branch, BranchPilot pauses and shows a banner. See Resolve conflicts.
Merge commits
A merge commit has two parents, so Git needs to know which side counts as the main line. For a merge commit the menu items read Cherry-pick this merge commit… and Revert this merge commit…, and a dialog asks you to pick a parent. Parent 1 is usually right: it is the branch the merge was made into. Cancelling the dialog does nothing.
Reset a branch
Resetting moves your current branch to another commit. Right-click the target commit and choose Reset branch to here… (the item shows your branch's name). It is unavailable with a detached HEAD.
| Mode | What it does |
|---|---|
| Soft | Moves the branch only. The index and working tree stay exactly as they are. |
| Mixed | Moves the branch and resets the index. The working tree stays as it is. This is the default. |
| Hard | Moves the branch and discards all index and working tree changes. |
With Soft and Mixed, the changes from the commits you stepped back over remain in your files, so you can commit them again differently.
DANGER
Hard throws away every uncommitted change to tracked files, staged or not. They cannot be recovered. BranchPilot makes you type the branch name before the Reset button works. Commits you step back over also drop out of the branch; if they were pushed, see force push.
Work in more than one worktree
A worktree is an extra folder that has another branch of the same repository checked out. It lets you fix something on one branch without disturbing the files of the branch you are working on.
Select the plus button on the Worktrees heading (Add worktree).
Type the absolute path for the new folder.
Type a name under New branch name to create a new branch there, or leave it empty and choose from Existing branch.
Select Add.
Select a worktree in the list to open it in its own tab. The list shows each worktree's branch, or detached or bare.
To remove one, open its menu (Worktree actions) and choose Remove…. If the worktree has modified or untracked files, BranchPilot stops with Worktree has changes and offers Force remove.
WARNING
Force remove deletes the worktree folder together with any uncommitted changes in it.