GIT-ADD(1) GIT-ADD(1) (NAME) git-add - (SYNOPSIS) git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse] [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize] [--chmod=(+|-)x] [--pathspec-from-file= [--pathspec-file-nul]] [--] [...] (DESCRIPTION) . <<>> ( << >> <> ) . git commit (staged) . file.c : git add file.c git commit git add -p . . () add git add . git status . git add (ignored) . --force . git add . . git-commit(1) . (OPTIONS) ... . ( *.c) . ( dir dir/file1 dir/file2) ( dir dir/file1 dir/file2 dir/file3 ). --no-all . pathspec gitglossary(7) . -n, --dry-run () / . -v, --verbose . -f, --force . submodule..ignore=all (stage) . path . --sparse sparse-checkout . git add sparse-checkout . git-sparse-checkout(1) . -i, --interactive . . << >> . -p, --patch (hunks) . . add --interactive patch . << >> . -U, --unified= (diffs) (context). diff.context . ( -U -p ). --inter-hunk-context= . diff.interHunkContext . -e, --edit . . (stage) . . . << >> . -u, --update . . -u ( ). -A, --all, --no-ignore-removal . . -A ( ). --no-all, --ignore-removal . (no-op) . git add ... git add --no-all ... . -N, --intent-to-add . . (unstaged) git diff git commit -a . --refresh () stat() . --ignore-errors . . add.ignoreErrors true . --ignore-missing --dry-run . . --no-warn-embedded-repo git add git submodule add .gitmodules . ( ). --renormalize <> . core.autocrlf text CRLF/LF . -u . CR CRLF LF CRCRLF CRLF . --chmod=(+|-)x (executable bit) . . --pathspec-from-file= (pathspec) . - . pathspec LF CR/LF . pathspec core.quotePath ( git-config(1) ). --pathspec-file-nul --literal-pathspecs . --pathspec-file-nul --pathspec-from-file . pathspec NUL ( ). -- ( ). (EXAMPLES) o *.txt Documentation : $ git add Documentation/\*.txt * Documentation/ . o git-*.sh: $ git add git-*.sh ( ) subdir/git-foo.sh . (INTERACTIVE MODE) status . "What now> " . > Return () : *** Commands *** 1: status 2: update 3: revert 4: add untracked 5: patch 6: diff 7: quit 8: help What now> 1 s sta status . ( help quit). status HEAD ( git commit ) ( git commit git add ) . : staged unstaged path 1: binary nothing foo.png 2: +403/-35 +1/-1 add-interactive.c foo.png HEAD ( ) ( nothing binary ). add-interactive.c ( ). update "Update>>" . >> . "2-5 7,9" 2 3 4 5 7 9 . "7-" 7 8 9 . * . * : staged unstaged path 1: binary nothing foo.png * 2: +403/-35 +1/-1 add-interactive.c - : Update>> -2 (stage) . revert update HEAD . (untracked) . add untracked update revert . patch status . (hunk) . Return () : y - stage this hunk n - do not stage this hunk q - quit; do not stage this hunk or any of the remaining ones a - stage this hunk and all later hunks in the file d - do not stage this hunk or any of the later hunks in the file g - select a hunk to go to / - search for a hunk matching the given regex j - go to the next undecided hunk, roll over at the bottom J - go to the next hunk, roll over at the bottom k - go to the previous undecided hunk, roll over at the top K - go to the previous hunk, roll over at the top s - split the current hunk into smaller hunks e - manually edit the current hunk p - print the current hunk P - print the current hunk using the pager ? - print help . interactive.singleKey true Return . diff ( HEAD ) . (EDITING PATCHES) git add -e e (patch) . . ( ) . . added content "+" . . removed content "-" . "-" " " () . modified content "-" ( ) "+" ( ) . "-" " " "+" . . . <<>> (undo) . HEAD (reverted) . . removing untouched content (context) " " () . "-" . . modifying existing content ( " " "-") "+" . "+" . . new content "+" . . : o (" ") ("-") o o (CONFIGURATION) git-config(1) . : add.ignoreErrors, add.ignore-errors () git add . --ignore-errors . add.ignore-errors . (SEE ALSO) git-status(1) git-rm(1) git-reset(1) git-mv(1) git-commit(1) git- update-index(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-ADD(1)