Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git add

Add files to staging area

Syntax

git add [options] [<pathspec>...]

Common Options

OptionDescription
.Add all changes in current directory
-A, --allAdd all changes including deletions
-p, --patchInteractively choose hunks to add
-u, --updateOnly update tracked files
-f, --forceForce add ignored files
-n, --dry-runDry run, show what would be added
-i, --interactiveInteractive mode
-v, --verboseVerbose output

Examples

git add file.txt

Add a single file

git add .

Add all changes in current directory

git add -A

Add all including deletions

git add -p

Interactively add code chunks

git add *.js

Add all JavaScript files

Related Tools

More Code & Dev Tools