DORMANTno replies

[PATCH 1/2] Documentation: 'git add --all' can remove files

From: Björn Gustavsson <hidden>
Date: 2016-06-15 22:47:50
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

Document that 'git add --all' can remove files no longer present
in the working tree from the index. Also mention why it is useful,
and insert a cross-reference in the 'git rm' documentation to
'git add --all'.

Signed-off-by: Björn Gustavsson <redacted>
---
 Documentation/git-add.txt |   13 +++++++++----
 Documentation/git-rm.txt  |    4 ++++
 2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index e93e606..b7e8aa2 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -16,6 +16,8 @@ DESCRIPTION
 -----------
 This command adds the current content of new or modified files to the
 index, thus staging that content for inclusion in the next commit.
+(Given the `--all` option, the `git add` command will also remove files
+from the index that are no longer present in the working tree.)
 
 The "index" holds a snapshot of the content of the working tree, and it
 is this snapshot that is taken as the contents of the next commit.  Thus
@@ -102,10 +104,13 @@ apply.
 
 -A::
 --all::
-	Update files that git already knows about (same as '\--update')
-	and add all untracked files that are not ignored by '.gitignore'
-	mechanism.
-
+	Update files that git already knows about (same as '\--update'),
+	add all untracked files that are not ignored by '.gitignore'
+	mechanism and remove files from the index that are no longer
+	present in the working tree.
++
+This option is especially useful after running the `rsync` command with
+the working tree as the target to sync the index with the working tree.
 
 -N::
 --intent-to-add::
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 5afb1e7..b4dff5b 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -81,6 +81,10 @@ two directories `d` and `d2`, there is a difference between
 using `git rm \'d\*\'` and `git rm \'d/\*\'`, as the former will
 also remove all of directory `d2`.
 
+To automatically remove all files from the index that are no longer
+present in the working tree, see the `--all` option for
+linkgit:git-add[1].
+
 EXAMPLES
 --------
 git rm Documentation/\\*.txt::
-- 
1.6.6.rc1.31.g1a56b
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help