]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/add.c
git-add --all: add all files
authorJunio C Hamano <gitster@pobox.com>
Sun, 20 Jul 2008 02:51:11 +0000 (19:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 20 Jul 2008 06:08:58 +0000 (23:08 -0700)
commit3ba1f114267b19a458df0f1d714dc4010ec9cc56
tree9db62a41da372423bdae70dcf85d5be78c5d4c66
parentc972ec04204b6edf4fe7ec0d59a3ce3564378303
git-add --all: add all files

People sometimes find that "git add -u && git add ." are 13 keystrokes too
many.  This reduces it by nine.

The support of this has been very low priority for me personally, because
I almost never do "git add ." in a directory with already tracked files,
and in a new directory, there is no point saying "git add -u".

However, for two types of people (that are very different from me), this
mode of operation may make sense and there is no reason to leave it
unsupported.  That is:

 (1) If you are extremely well disciplined and keep perfect .gitignore, it
     always is safe to say "git add ."; or

 (2) If you are extremely undisciplined and do not even know what files
     you created, and you do not very much care what goes in your history,
     it does not matter if "git add ." included everything.

So there it is, although I suspect I will not use it myself, ever.

It will be too much of a change that is against the expectation of the
existing users to allow "git commit -a" to include untracked files, and
it would be inconsistent if we named this new option "-a", so the short
option is "-A".  We _might_ want to later add "git commit -A" but that is
a separate topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-add.c