This then should result in the same outcome right?
Not exactly
Since *
does not match hidden files in the shell, git add *
will not add the hidden files/dirs in the current directory (but hidden files in subdirs will match since you add the full dir).
git add .
will add everything, including hidden files in current dir.
Simple POC to illustrate:
$ tree -a
.
├── blah
├── .hidden
└── some
├── dir
│ ├── .hidden
│ └── titi
├── .hidden
└── tata
2 directories, 6 files
$ git init
Initialized empty Git repository in /mydir/.git/
$ git add *
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: blah
new file: some/.hidden
new file: some/dir/.hidden
new file: some/dir/titi
new file: some/tata
Untracked files:
(use "git add <file>..." to include in what will be committed)
.hidden
$ git add .
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .hidden
new file: blah
new file: some/.hidden
new file: some/dir/.hidden
new file: some/dir/titi
new file: some/tata