For the first question, consider this example:
git: myrepo/foo $ vim 1.c
git: myrepo/foo $ vim ../bar/2.c
Now when I do git add .
, only myrepo/foo/1.c
will be tracked, but myrepo/bar/2.c
won't be tracked. git add -A
will, however, track both.
If you issue git add .
in the top directory of your working tree, it makes no difference from git add -A
. This doesn't hold true if you're in a subdirectory.
For question 2, I honestly don't know why. I'm running Git 2.17.0 and from the manpage (git add --help
), I see this:
--no-all, --ignore-removal
Update the index by adding new files that
are unknown to the index and files
modified in the working tree, but ignore
files that have been removed from the
working tree. This option is a no-op when
no <pathspec> is used.
This option is primarily to help users
who are used to older versions of Git,
whose "git add <pathspec>..." was a
synonym for "git add --no-all
<pathspec>...", i.e. ignored removed
files.
It's good as a substitute for the functionality changed from Git 1.0.