Difference between ‘git add . ‘ and ‘git add * ‘

What is the difference between the git add . and git add *?

$git add .

This adds all new and modified files in the current directory, including hidden folders and files (ones that begin with a ‘ . ‘).

$git add -A

This adds all new, modified, and deleted files in the current directory.

$git add *

Adds all files and directories EXCEPT ones┬áthat are hidden (begin with a ‘ . ‘ (dot)). The asterisk is actually a shell command and not part of git.


Here is an image from StackOverflow that also addresses the question:

git add bash shell

Advertisements