From fdc97abd4a8b04781356dc561b4ba5a634f9854f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 22 Apr 2013 14:30:22 -0700 Subject: git add ... defaults to "-A" Make "git add ..." notice paths that have been removed from the working tree, i.e. the same as "git add -A ...". Given that "git add " is to update the index with the state of the named part of the working tree as a whole, it makes it more intuitive, and also makes it possible to simplify the advice we give while marking the paths the user finished resolving conflicts with. We used to say "to record removal as a resolution, remove the path from the working tree and say 'git rm'; for all other cases, edit the path in the working tree and say 'git add'", but we can now say "update the path in the working tree and say 'git add'" instead. As promised, this merges the temporary update_files_in_cache() helper function back to add_files_to_cache() function. Signed-off-by: Junio C Hamano --- Documentation/git-add.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 48754cbc6..ee0f95cbd 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -53,8 +53,14 @@ OPTIONS 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` - and `dir/file2`) can be given to add all files in the - directory, recursively. + and `dir/file2`) can be given to update the index to + match the current state of the directory as a whole (e.g. + specifying `dir` will record not just a file `dir/file1` + modified in the working tree, a file `dir/file2` added to + the working tree, but also a file `dir/file3` removed from + the working tree. Note that older versions of Git used + to ignore removed files; use `--no-all` option if you want + to add modified or new files but ignore removed ones. -n:: --dry-run:: @@ -129,11 +135,9 @@ of Git, hence the form without should not be used. files that have been removed from the working tree. This option is a no-op when no is used. + -This option is primarily to help the current users of Git, whose -"git add ..." ignores removed files. In future versions -of Git, "git add ..." will be a synonym to "git add -A -..." and "git add --ignore-removal ..." will behave like -today's "git add ...", ignoring removed files. +This option is primarily to help users who are used to older +versions of Git, whose "git add ..." was a synonym +for "git add --no-all ...", i.e. ignored removed files. -N:: --intent-to-add:: -- cgit v1.2.1