c commits what is in the index. A folds the index into the last commit
instead. Both open the same message editor.
Commit what is staged
Section titled “Commit what is staged”- Press
c. The message editor opens. - Type the message. The first line is the subject.
- Press
ctrl+s.
ctrl+s writes the commit.The title of the editor counts the files you are about to commit. With nothing
staged, c shows nothing staged to commit and opens no editor.
Amend the last commit
Section titled “Amend the last commit”- Stage the changes you want to add.
- Press
A. The editor opens with the message of the last commit. - Change the message, or keep it.
- Press
ctrl+s.
An amend replaces the last commit. The commit count does not grow.
CAUTION: Do not amend a commit that other people already pulled. An amend gives the commit a new hash, and their history no longer matches yours.
Commit without hooks
Section titled “Commit without hooks”Press w to commit with --no-verify. The editor opens with WIP in it, and
the title says that hooks are skipped.
This is the only way to skip hooks. A message that starts with WIP does not
skip them by itself.
Write the message in your editor
Section titled “Write the message in your editor”Press C to write the message in $EDITOR instead. stage gives the terminal to
your editor, and takes it back when the editor exits.
Use this command when you want your commit.template, or the output of a
prepare-commit-msg hook. The modal editor never shows either of them.
stage compares HEAD before and after to learn what happened, because the exit
code of an editor says nothing about git. If nothing was committed, stage shows
commit aborted — nothing committed.
Change an older commit
Section titled “Change an older commit”Move to the commits panel with 4. These commands run as a rebase.
| Key | Action |
|---|---|
r |
Change the message of the commit under the cursor |
A |
Fold the staged changes into the commit under the cursor |
a |
Change the author of the commit |
Signed commits
Section titled “Signed commits”A signed commit shows a Signed: row in the commit view. An unsigned commit
shows nothing, so a repository that does not sign gets no extra noise.
Your signing agent can be locked when you commit. git then waits for a passphrase that it cannot ask for, and the commit does not finish.
stage notices this. It shows the blocked write, and gives you three answers:
| Answer | Result |
|---|---|
| Unlock | stage gives the terminal to the passphrase prompt of the agent |
| Abort | stage stops the write. The commit is lost |
| Keep waiting | The prompt closes. The write continues |
The prompt also closes by itself if you unlock the agent somewhere else and the commit finishes.
In the message editor, ctrl+g unlocks the signing agent. stage shows this key
only when git is configured to sign.