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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s