In my git repository I manually deleted a file(rm
) after moving it to another folder. I than committed all the changes to my repo but now when I do git status .
ronnie@ronnie:/home/github/Vimfiles/Vim$ git status .
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: plugin/dwm.vim
#
no changes added to commit (use "git add" and/or "git commit -a")
Now, how should I commit so that dwm.vim
is deleted from the plugin folder in my remote repo. I know that I have to use git add && git commit
but I have no file to commit/add because /plugin/dwm.vim
is already deleted.
The answer's here, I think.
It's better if you do git rm <fileName>
, though.
It says right there in the output of git status
:
# (use "git add/rm <file>..." to update what will be committed)
so just do:
git rm <filename>
Use git add -A
, this will include the deleted files.
Note: use git rm
for certain files.
Source: Stackoverflow.com