If we want to delete a file (say file1.txt) and stop the git repo to track it, it is said that we should use git rm file1.txt and then git commit -m "..." it. But deleting from the working directory by OS, rm file1.txt, add . and then git commit -m "..." do the same. what are their difference?
what does git rm do as opposed to deleting by OS and git add
1k views Asked by b3hn4m At
2
There's no difference.
git addof a tracked file you've removed from the work tree removes the index entry. A tracked file is what's in the work tree and the index record for it, there's nothing else, your sequence is exactlygit rm.