If you want to add all files, don't use '*' (which is interpreted by the shell)
git add .
git add -u
would add updated files. git add -A .
combines the two.
See "What's the difference between git add .
and git add -u
?"
Also "Difference between “git add -A” and “git add .”":
The .
indicates the command operates in the current subdirectory instead of the entire working tree.
If you want to known if a file is ignored: git check-ignore -v -- yourFile
.
As explained in "What's the difference between git add *
and git add .
, if any?":
git add *
will add all the paths that are the result of the shell expansion of *
whereas git add .
will tell git to add the current directory.
git add *
won't add paths that begin with a .
as the shell expansion of *
considers these to be "hidden" paths.
torek explains in the comments why '*
' fails in this particular scenario:
in this particular case, git add *
becomes
git add Bootstrap afile bfile ... index.php main.js ... zfile
or some such, and git add *
stops with a fatal error because you told it:
- "don't add
Bootstrap
via .gitignore
", and
- "do add Bootstrap via explicit path"
It does not know which to obey, so it does nothing at all.