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
The -a
switch tells git to stage the modified files for adding - it stands for 'all' not 'add'. If you wan't the content in a new file to be added to git then you must add it using git add before you commit it.
If you have already done a git add .
then it has already added all files in the current directory i.e. both new and modified files. Hence you don't need a -a
switch to stage content again. So you can rightly just follow it up with a git -m "msg"