git add * (asterisk) vs git add . (period)

* is not part of git - it's a wildcard interpreted by the shell. * expands to all the files in the current directory, and is only then passed to git, which adds them all. . is the current directory itself, and git adding it will add it and the all the files under it.


add * means add all files in the current directory, except for files whose name begin with a dot. This is your shell functionality and Git only ever receives a list of files.

add . has no special meaning in your shell, and thus Git adds the entire directory recursively, which is almost the same, but including files whose names begin with a dot.


  • git add -A (--all) Adds everything, so that everything in your folder on disk is represented in the staging area

  • git add . Stages everything, but does not remove files that have been deleted from the disk

  • git add * Stages everything, but not files that begin with a dot & does not remove files that have been deleted from the disk

  • git add -u (--update) Stages only Modified Files, removes files that have been deleted from disk, does not add new

  • git add <file name 1> <file name 2> Adds only certain file(s)