@@ -14,28 +14,32 @@ SYNOPSIS
1414
1515DESCRIPTION
1616-----------
17- This command adds the current content of new or modified files to the
18- index, thus staging that content for inclusion in the next commit.
17+ This command updates the index using the current content found in
18+ the working tree, to prepare the content staged for the next commit.
19+ It typically adds the current content of existing paths as a whole,
20+ but with some options it can also be used to add content with
21+ only part of the changes made to the working tree files applied, or
22+ remove paths that do not exist in the working tree anymore.
1923
2024The "index" holds a snapshot of the content of the working tree, and it
2125is this snapshot that is taken as the contents of the next commit. Thus
2226after making any changes to the working directory, and before running
23- the commit command, you must use the ' add' command to add any new or
27+ the commit command, you must use the ` add` command to add any new or
2428modified files to the index.
2529
2630This command can be performed multiple times before a commit. It only
2731adds the content of the specified file(s) at the time the add command is
2832run; if you want subsequent changes included in the next commit, then
29- you must run ' git add' again to add the new content to the index.
33+ you must run ` git add` again to add the new content to the index.
3034
31- The ' git status' command can be used to obtain a summary of which
35+ The ` git status` command can be used to obtain a summary of which
3236files have changes that are staged for the next commit.
3337
34- The ' git add' command will not add ignored files by default. If any
35- ignored files were explicitly specified on the command line, ' git add'
38+ The ` git add` command will not add ignored files by default. If any
39+ ignored files were explicitly specified on the command line, ` git add`
3640will fail with a list of ignored files. Ignored files reached by
3741directory recursion or filename globbing performed by Git (quote your
38- globs before the shell) will be silently ignored. The ' add' command can
42+ globs before the shell) will be silently ignored. The ` add` command can
3943be used to add ignored files with the `-f` (force) option.
4044
4145Please see linkgit:git-commit[1] for alternative ways to add content to a
@@ -92,28 +96,31 @@ apply.
9296
9397-u::
9498--update::
95- Update only files that git already knows about, staging modified
96- content for commit and marking deleted files for removal. This
97- is similar
98- to what "git commit -a" does in preparation for making a commit,
99- except that the update is limited to paths specified on the
100- command line. If no paths are specified, all tracked files in the
101- current directory and its subdirectories are updated.
99+ Only match <filepattern> against already tracked files in
100+ the index rather than the working tree. That means that it
101+ will never stage new files, but that it will stage modified
102+ new contents of tracked files and that it will remove files
103+ from the index if the corresponding files in the working tree
104+ have been removed.
105+ +
106+ If no <filepattern> is given, default to "."; in other words,
107+ update all tracked files in the current directory and its
108+ subdirectories.
102109
103110-A::
104111--all::
105- Update files that git already knows about (same as '\--update')
106- and add all untracked files that are not ignored by '.gitignore'
107- mechanism.
108-
112+ Like `-u`, but match <filepattern> against files in the
113+ working tree in addition to the index. That means that it
114+ will find new files as well as staging modified content and
115+ removing files that are no longer in the working tree.
109116
110117-N::
111118--intent-to-add::
112119 Record only the fact that the path will be added later. An entry
113120 for the path is placed in the index with no content. This is
114121 useful for, among other things, showing the unstaged content of
115- such files with ' git diff' and committing them with ' git commit
116- -a' .
122+ such files with ` git diff` and committing them with ` git commit
123+ -a` .
117124
118125--refresh::
119126 Don't add the file(s), but only refresh their stat()
@@ -133,7 +140,7 @@ apply.
133140Configuration
134141-------------
135142
136- The optional configuration variable ' core.excludesfile' indicates a path to a
143+ The optional configuration variable ` core.excludesfile` indicates a path to a
137144file containing patterns of file names to exclude from git-add, similar to
138145$GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to
139146those in info/exclude. See linkgit:gitrepository-layout[5].
@@ -181,17 +188,17 @@ and type return, like this:
181188 What now> 1
182189------------
183190
184- You also could say "s" or " sta" or " status" above as long as the
191+ You also could say `s` or ` sta` or ` status` above as long as the
185192choice is unique.
186193
187194The main command loop has 6 subcommands (plus help and quit).
188195
189196status::
190197
191198 This shows the change between HEAD and index (i.e. what will be
192- committed if you say " git commit" ), and between index and
199+ committed if you say ` git commit` ), and between index and
193200 working tree files (i.e. what you could stage further before
194- " git commit" using " git- add" ) for each path. A sample output
201+ ` git commit` using ` git add` ) for each path. A sample output
195202 looks like this:
196203+
197204------------
0 commit comments