I am wanting to delete some old files on my repository due to some refactoring. Git is saying my local repo is up-to-date. However when I run git status I get the following:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: app/foo1.php
# deleted: app/foo2.php
# deleted: app/foo3.php
# deleted: app/foo4.php
# deleted: app/foo5.php
# deleted: app/foo6.php
Prior to this I used git rm <file> to commit them.
deleted files for good? By this I mean when I
run git status it shows Everything up-to-date`
By using git rm you actually deleted the files, but you still have to apply your changes to the local and the remote repositories.
To do so, use the following commands:
git commit -m "clean up"
git push origin master
The first one commits your changes on your local repository and make them available for the next push to the remote repository. The second command actually delivers the changes.
Of course, feel free to personalize the message for the commit. Moreover, I'm assuming that you are working on the master branch, if it's not set it correctly to the proper one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With