I deleted a file using git rm test and currently this is the output of git status .
Noob@Noob:/media/data/bitbucket/pythonscripts$ git status .
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: test
#
Now when I try to push the change in my repo using git push it says Everything up-to-date. I understand that normally one needs to first add and than commit before push but in my case what do I add beacause I have already deleted the file.
Also if I do git commit -m "commit message" will this override all my commits because currently I have no file to attach this commit to.
After doing
git rmyou need to dogit commit. Git says thatEverything up-to-dateis because you have not created a commit with this file removed.For example if you do
git reset --hardyou’ll see that your file is back.In general
git rmis no different fromgit add.No it won’t, it will create a new commit with this file removed.