Difference between $ git add --all vs $ git add *?

When I did $ git add *, sometimes I realized that git does not add deleted files to the scene, and I need to specify manually if to delete or add it, but I can not understand what the difference is with $ git add --all. Therefore, if the asterisk () indicates "all" () , why does git not add everything as ** - all flag ??

I checked the git git-add documentation and a little difference between "git add -A" and "git add." but the case of using an asterisk is not indicated.

Also the first answer in git add * (asterisk) vs git add. (period) indicates:

add * means adding all files to the current directory, with the exception of files whose name begins with a period. This is your shell functionality, in fact git only gets a list of files.

So this is identical to * and -all?

thanks

+4
source share
1 answer

The difference is as follows:

  • git add -Awill add everything from the top git repo folder .
    It works on the entire working tree, and not just on the current path.
  • git add *will add files (as extended by the shell) from the current folder.
    It works starting from the current path.
+5
source

Source: https://habr.com/ru/post/1615687/


All Articles