{"thread":{"id":"21886","subject":"[PATCH] Documentation: 'git add -A' can remove files","startedAt":"2009-12-07T08:20:09Z","lastAt":"2009-12-07T08:20:09Z","messageCount":1,"participants":["Björn Gustavsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"129388","messageId":"4B1CBAB9.7030306@gmail.com","threadId":"21886","inReplyTo":null,"subject":"[PATCH] Documentation: 'git add -A' can remove files","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-12-07T08:20:09Z","receivedAt":"2009-12-07T08:20:09Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"The current documentation fails to mention that 'git add -A/--all'\ncan remove files as well as add them, and it also does not\nsay anything about filepatterns (whether they are allowed,\nmandatory, or optional). It is also not clear what the similarities\nand differences to the -u option are.\n\nUpdate the intro paragraph (as suggested by Junio, with some minor\nedits) to make it clear that 'git add' is able to delete and to\nalso cover the -p option.\n\nReword the description of -u to make it clearer (based on by\nBjörn Steinbrink's suggestion).\n\nSimplify the description of  -A by saying \"Like -u\" and then\ndescribe the differences (based on the suggestions by Björn\nSteinbrink and Junio).\n\nSigned-off-by: Björn Gustavsson <bgustavsson@gmail.com>\n---\nI have to leave for work now, so I'll just send the first part\nnow, which I think is much improved compared to\nthe previous version. Thanks Junio and Björn S for the\nsuggestions.\n\n Documentation/git-add.txt |   33 ++++++++++++++++++++-------------\n 1 files changed, 20 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/git-add.txt b/Documentation/git-add.txt\nindex e93e606..ed68ea3 100644\n--- a/Documentation/git-add.txt\n+++ b/Documentation/git-add.txt\n@@ -14,8 +14,12 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n-This command adds the current content of new or modified files to the\n-index, thus staging that content for inclusion in the next commit.\n+This command updates the index using the current content found in\n+the working tree, to prepare the content staged for the next commit.\n+It typically adds the current content of existing paths as a whole,\n+but with some options it can also be used to add content with\n+only part of the changes made to the working tree files applied, or\n+remove paths that do not exist in the working tree anymore.\n \n The \"index\" holds a snapshot of the content of the working tree, and it\n is this snapshot that is taken as the contents of the next commit.  Thus\n@@ -92,20 +96,23 @@ apply.\n \n -u::\n --update::\n-\tUpdate only files that git already knows about, staging modified\n-\tcontent for commit and marking deleted files for removal. This\n-\tis similar\n-\tto what \"git commit -a\" does in preparation for making a commit,\n-\texcept that the update is limited to paths specified on the\n-\tcommand line. If no paths are specified, all tracked files in the\n-\tcurrent directory and its subdirectories are updated.\n+\tOnly match <filepattern> against already tracked files in\n+\tthe index rather than the working tree. That means that it\n+\twill never stage new files, but that it will stage modified\n+\tnew contents of tracked files and that it will remove files\n+\tfrom the index if the corresponding files in the working tree\n+\thave been removed.\n++\n+If no <filepattern> is given, default to \".\"; in other words,\n+update all tracked files in the current directory and its\n+subdirectories.\n \n -A::\n --all::\n-\tUpdate files that git already knows about (same as '\\--update')\n-\tand add all untracked files that are not ignored by '.gitignore'\n-\tmechanism.\n-\n+\tLike `-u`, but match <filepattern> against files in the\n+\tworking tree in addition to the index. That means that it\n+\twill find new files as well as staging modified content and\n+\tremoving files that are no longer in the working tree.\n \n -N::\n --intent-to-add::\n-- \n1.6.6.rc1.31.g1a56b\n"}]}