git add: start preparing for "git add <pathspec>..." to default to "-A"
[gitweb.git] / Documentation / git-add.txt
index 533355984cf00bc81f21dfeee4a4e8977631f423..5c501a299e2d88f3c3565b180a59187dea042fcb 100644 (file)
@@ -9,9 +9,9 @@ SYNOPSIS
 --------
 [verse]
 'git add' [-n] [-v] [--force | -f] [--interactive | -i] [--patch | -p]
-         [--edit | -e] [--all | [--update | -u]] [--intent-to-add | -N]
+         [--edit | -e] [--[no-]all | [--update | -u]] [--intent-to-add | -N]
          [--refresh] [--ignore-errors] [--ignore-missing] [--]
-         [<filepattern>...]
+         [<pathspec>...]
 
 DESCRIPTION
 -----------
@@ -49,7 +49,7 @@ commit.
 
 OPTIONS
 -------
-<filepattern>...::
+<pathspec>...::
        Files to add content from.  Fileglobs (e.g. `*.c`) can
        be given to add all matching files.  Also a
        leading directory name (e.g. `dir` to add `dir/file1`
@@ -100,24 +100,38 @@ apply to the index. See EDITING PATCHES below.
 
 -u::
 --update::
-       Only match <filepattern> against already tracked files in
-       the index rather than the working tree. That means that it
-       will never stage new files, but that it will stage modified
-       new contents of tracked files and that it will remove files
-       from the index if the corresponding files in the working tree
-       have been removed.
+       Update the index just where it already has an entry matching
+       <pathspec>.  This removes as well as modifies index entries to
+       match the working tree, but adds no new files.
 +
-If no <filepattern> is given, the current version of Git defaults to
+If no <pathspec> is given, the current version of Git defaults to
 "."; in other words, update all tracked files in the current directory
 and its subdirectories. This default will change in a future version
-of Git, hence the form without <filepattern> should not be used.
+of Git, hence the form without <pathspec> should not be used.
 
 -A::
 --all::
-       Like `-u`, but match <filepattern> against files in the
-       working tree in addition to the index. That means that it
-       will find new files as well as staging modified content and
-       removing files that are no longer in the working tree.
+       Update the index not only where the working tree has a file
+       matching <pathspec> but also where the index already has an
+       entry.  This adds, modifies, and removes index entries to
+       match the working tree.
++
+If no <pathspec> is given, the current version of Git defaults to
+"."; in other words, update all files in the current directory
+and its subdirectories. This default will change in a future version
+of Git, hence the form without <pathspec> should not be used.
+
+--no-all::
+       Update the index by adding new files that are unknown to the
+       index and files modified in the working tree, but ignore
+       files that have been removed from the working tree.  This
+       option is a no-op when no <pathspec> is used.
++
+This option is primarily to help the current users of Git, whose
+"git add <pathspec>..." ignores removed files.  In future versions
+of Git, "git add <pathspec>..." will be a synonym to "git add -A
+<pathspec>..." and "git add --no-all <pathspec>..." will behave like
+today's "git add <pathspec>...", ignoring removed files.
 
 -N::
 --intent-to-add::