git add Stage changes to include in the next commit

Moves changes from your working folder into the staging area, the draft of your next commit. This lets you commit only the parts you want, not everything at once.

Synopsis

git add [OPTION]... PATH...

Common options

Option or formWhat it does
PATHA file or folder to stage. A dot (.) means everything here
-A, --allStage new, changed and deleted files across the whole repository
-p, --patchWalk through each change and choose which pieces to stage
-uStage changes to files Git already tracks, but not new files
-n, --dry-runShow what would be staged without doing it

Examples

Stage one file
git add index.html
Stage everything in the current folder
git add .
Choose pieces of a file interactively
git add -p app.js
Stage all tracked files that changed
git add -u
Preview before staging
git add --dry-run .
add 'notes.txt'

Notes

See also

Last reviewed 2026-10-09.