Skip to content

Committing staged changes

Committing happens right where you decided what belongs in it: write a message in the staging panel and confirm, and it becomes the new HEAD — no separate window, no context switch. Whatever you left unstaged stays behind, untouched, waiting for a commit of its own.

Committing the staged changes records a new HEAD commit

The staging panel's message box is the only place a commit gets written: type a subject, click commit, and the staged files become a real commit on HEAD immediately — the graph reflects it as the new topmost row without a refresh. Anything left unstaged is untouched by the commit and stays exactly where it was, ready to be staged and committed on its own.

Committing the staged changes records a new HEAD commit

Captured from the running app by this scenario.

Do this

  1. Select the working-tree changes in the graph
  2. Enter the commit message chore: bump service version to api-v2
  3. Commit the staged changes

You should see

  • The repository HEAD commit subject is chore: bump service version to api-v2
  • The commit graph is shown

Amending the previous commit rewrites it instead of stacking a new one

Ticking "Amend previous commit" needs no staged file of its own — it fills the message box with the commit it's about to replace, ready to edit, and confirming rewrites that commit in place rather than adding a new one on top of it.

Amending the previous commit rewrites it instead of stacking a new one

Captured from the running app by this scenario.

Do this

  1. Select the working-tree changes in the graph
  2. Enter the commit message chore: bump service version to api-v2
  3. Commit the staged changes
  4. Select the working-tree changes in the graph
  5. Turn on the amend-previous-commit option
  6. Enter the commit message chore: bump service version to api-v3
  7. Commit the staged changes

You should see

  • The repository HEAD commit subject is chore: bump service version to api-v2
  • The commit message box holds chore: bump service version to api-v2
  • The repository HEAD commit subject is chore: bump service version to api-v3
  • The commit before HEAD has the subject base: add config

This page is generated from apps/e2e/features/commit.feature, the end-to-end test that drives the feature it describes.

MIT licensed · Screenshots exported from the real app by the end-to-end suite.