I’m having trouble getting git rm to delete a now superfluous directory and it’s files from a project. This made me wonder why git rm is the accepted practice when deleting tracked files instead of rm -rf the directory and files outside of git and then git add -u to stage and prepare deletion of the previously tracked files? The latter seems to make much more sense to me but I probably dont understand the advantages of git rm.
I’m having trouble getting git rm to delete a now superfluous directory and it’s
Share
Of course, there are always multiple ways to do something. Some advantages that using
git rmhas, are:git rm --cached.git add -uwhich adds all changes to the index.Especially the last one is very important to me personally, as I want full control about what change I add to a commit. So using
add -uwill rarely make me happy (just likeadd .). But of course, if you are happy with usingadd -u, feel free to use it.