In this chapterStage the changes you want and make a clear commit.
Review changes
Stage what you need
Make a commit
Open the Changes tab.
Stage what you want
- Stage, unstage or discard by file, by hunk or by single line.
- Drag files between Unstaged and Staged, or onto the bin to discard.
- Folders view: files under their folders; fold one, collapse all, stage a whole folder.
- Restore the last discard if you change your mind, or use Snapshots (taken automatically before every discard or hard reset) to go back.
Read the changes
- Word-level highlights and syntax colours.
- Moved lines shown in blue, not as a deletion plus an addition.
- Ignore whitespace, choose lines of context, wrap long lines.
- Image changes side by side, as an onion skin, or with a swipe.
- Text encoding: files that aren’t UTF-8 can be read in their own encoding.
- Right-click a file’s header for its actions (stage, discard, open, copy path or full path, history…).
- Edit before staging: change a hunk’s text and stage that version.
Commit
- Write a message: a short summary on the first line, then (optionally) a description. Settings can show a separate description box.
- Helpers: subject length guide, spell check, gitmoji, commit
templates (the repo’s and your own, with
{branch},{issue},{ticket},{author},{date}…), conventional commits (type and scope), co-authors, sign-off, and Wrap the description at 72. - Press Commit (or Ctrl+Enter). The account is shown under the button, so you always know who you’re committing as.
Options: Amend the last commit, or Skip commit hooks once.
Smart tools
- Fold into an older commit: amend any earlier commit on the branch with what’s staged; Absorb sends each staged file to the commit that last changed it.
- Changelists: group changed files and commit a group to any branch without switching.
- Protected branches: a warning if the branch only accepts pull requests, with an offer to move your work to a new branch.
- Team awareness: a badge on files someone else is also changing on another remote branch.
- Ignore a file, its extension or folder; restore a file from any commit.
- Patches: export, apply, share as a secret gist link, or email them.
Check the result
The commit appears in History with the intended author, message and changes.
Next step: Review the sync status before pushing.
Need another approach?Find a fix →