Press 3 for the branches panel. The panel holds three tabs: local branches,
remotes, and tags. Press ] or [ to change the tab.
Move between branches
Section titled “Move between branches”| Key | Action |
|---|---|
space |
Check out the branch under the cursor |
c |
Check out a branch by name |
F |
Check out, and throw away the local changes |
- |
Go back to the branch you came from |
c searches the branch names while you type, so a long name needs only a few
letters.
CAUTION: F deletes the changes in your working tree. Use space first, and
read what git says when it refuses.
Make a branch
Section titled “Make a branch”- Move the cursor to the commit or the branch you want to start from.
- Press
n. - Type the name and press
enter.
| Key | Action |
|---|---|
n |
New branch |
R |
Rename the branch |
d |
Delete the branch |
N |
Move commits onto a new branch |
Before it deletes, stage asks git whether the branch is contained in HEAD. A
branch that is not merged needs a second confirmation.
Bring branches together
Section titled “Bring branches together”| Key | Action |
|---|---|
M |
Merge the branch under the cursor into the current one |
r |
Rebase the current branch onto the branch under the cursor |
f |
Fast-forward the branch under the cursor, without checking it out |
A merge and a rebase can both stop on a conflict. Read Conflicts for the keys that finish them.
Push and pull
Section titled “Push and pull”| Key | Action |
|---|---|
p |
Pull |
P |
Push |
A branch with no upstream is published with -u origin <branch>, so the first
push also sets the tracking branch.
If the remote moved, git rejects the push. stage then asks whether to push with
--force-with-lease. It never sends that flag without your answer.
stage reads the result of a push from git push --porcelain, which marks a
rejected ref with !. It does not read the message text, so a git in another
language still gives the correct answer.
How pull integrates
Section titled “How pull integrates”pullMode in the configuration decides this:
| Value | Result |
|---|---|
auto |
stage adds no flag. Your pull.rebase and pull.ff settings decide |
merge |
--no-rebase |
rebase |
--rebase |
ff-only |
--ff-only |
auto is the default. Your git configuration already answers this question, and
two answers in two places disagree sooner or later.
Remotes
Section titled “Remotes”Press ] from the branches tab for the remotes.
| Key | Action |
|---|---|
enter |
Show the branches of the remote |
space |
Check out the remote branch |
n |
Add a remote |
e |
Change the URL of a remote |
d |
Delete a remote |
f |
Fetch |
Pull requests
Section titled “Pull requests”| Key | Action |
|---|---|
o |
Create a pull request |
O |
Pull request options |
G |
Open the pull request in the browser |
ctrl+y |
Copy the URL of the pull request |
The branches panel marks a branch that has an open pull request.
github.com and gitlab.com need no configuration. For a self-hosted forge, add
the host to services in the configuration. Read
Configuration.
Compare
Section titled “Compare”Press W on a branch to mark it. Every branch you select after that is compared
against the mark. Press ctrl+t to open your difftool.