Re: [PATCH 1/2] Documentation: 'git add -A' can remove files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 7, 2009, 07:34 UTC
- Message-ID
- <7vbpib9r10.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20091207005732.GA20909@atjola.homenet>
Björn Steinbrink <B.Steinbrink@gmx.de> writes:
Show 9 quoted lines
> 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.
Hmm, an interesting way of teaching. How effective is it with the real new to mid-level users we see on the #git channel?
Show 6 quoted lines
> So maybe something like this? > ... > -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.
Sounds easier to read to me but I think this description of "-A" seems backwards from your explanation. "Like -u" means "matches the index" and the difference is it in addition matches with the work tree, so it should probably be the other way around, i.e.
Like -u, but matches <filepattern> against files in the work tree in
addition to the index. This means that it can find new files as well.