In some cases you may run the git commit --all
command and think that it will stage and commit all the changes, deletions and new files that you have in your project. The truth is in the documentation of the git commit
, though…
-a
--all
Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.
This means that in order to add new files to the repository you can’t just run git commit
. Instead you have to run git add
and then git commit
.