Re: [PATCH 1/2] Documentation: 'git add -A' can remove files
From: Björn Steinbrink <hidden>
Date: 2016-06-15 22:47:50
On 2009.12.06 15:31:25 -0800, Junio C Hamano wrote:
I wonder if we can restructure the description of "-u" to make it easier to read, to simplify the description of "-A".
What I usually say on #git is something like:
"git add <path>" looks at the working tree to find files
matching <path>. "git add -u <path>" looks at the index, and
"git add -A <path>" looks at both. Therefore "add" and "add -A"
can add new files to the index, and "add -u" and "add -A" can
remove files from it.
And for convenience, -u and -A default to "." as the path argument.
So maybe something like this?
-u, --update
Instead of matching <filepattern> against files in the working tree,
it is matched against the already tracked files in the index. This
means that it won't find any new files, but can find files already
deleted from the working tree and remove them from the index. Also,
if no <filepattern> is given, this option will make it default to
".", updating all tracked files in the current directory and its
subdirectories.
-A, --all
Like -u, but matches <filepattern> against files in the index in
addition to the files in working tree. This means that it can find
new files as well.
Björn