Is it redundant to run git add .
and then git commit -am \"commit message\"
?
Can I just run git add .
and then git commit -m
With Git before version 2.0, it's not redundant to run git commit -am
if you deleted any tracked files. See further explanation of the options below.
As long as you're in the root directory, and you want to add all new files, modifications and deletions, you want 3) below.
1) Commit new files and modifications to previously-tracked files, but don't add deletions.
With Git < 2.0:
$ git add .
$ git commit -m
With Git >= 2.0:
$ git add --ignore-removal .
$ git commit -m
2) Commit modifications and deletions to tracked files, but don't add new files.
$ git commit -am
3) Commit new files and all changed tracked files (both modifications and deletions). Either:
With Git < 2.0:
$ git add .
$ git commit -am
...Or:
$ git add -A
$ git commit -m
With Git >= 2.0:
$ git add .
$ git commit -m