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
Actually, git commit -a
is not always redundant, as it also removing files! For example you have two files: One file is tracked the other not. Now you want to delete the tracked (everywhere) and add the not tracked.
So you remove the tracked file. If you then use only git add .
and then git commit
it will track the new but won't delete the old file in the repository.
So you either execute git rm …
or using git commit -a
.