I guess I finally get it
If you make changes to a file file_a.txt
and then do
git add file_a.txt
rm file_a.txt
git commit -m 'Commit message'
Although the file is removed from the working directory (i.e from disk, or moved to the trash bin), it is not removed from the staging area, therefore the changes in the staging area (i.e index) will be committed
if instead you do
git add file_a.txt
git rm file_a.txt
git commit -m 'Commit message'
The file will be deleted from disk and from the staging area, so changes will not be committed
Now if after your last commit, you do either
rm file_a.txt
git commit -m 'Commit message'
or
git rm file_a.txt
git commit -m 'Commit message'
It should make no difference, because you did not add any changes to the staging area or index, so there is only on copy of the file in the working directory, so both command will have the same impact
So in summary rm
will just remove from disk, not from staging area
git rm
will remove from both disk and staging area (a special git area that you cannot reach by regular windows or linux commands)