public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Björn Gustavsson" <bgustavsson@gmail•com>
To: git@vger•kernel.org
Cc: Junio C Hamano <gitster@pobox•com>
Subject: [PATCH 1/2] Documentation: 'git add --all' can remove files
Date: Sun, 06 Dec 2009 19:07:14 +0100	[thread overview]
Message-ID: <4B1BF2D2.8000506@gmail.com> (raw)

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 <bgustavsson@gmail•com>
---
 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

             reply	other threads:[~2009-12-06 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-06 18:07 Björn Gustavsson [this message]
2009-12-06 21:14 ` [PATCH 1/2] Documentation: 'git add --all' can remove files Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B1BF2D2.8000506@gmail.com \
    --to=bgustavsson@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox