Git: How to commit a manually deleted file?

In my git repository, I manually deleted the ( rm ) file by moving it to another folder. I made all the changes in my repo, but now that I am doing 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 do I make dwm.vim be deleted from the plugin folder in my remote repo. I know that I need to use git add && git commit , but I don’t have a file to commit / add because /plugin/dwm.vim already deleted.

+47
git github
Oct 20 '12 at 11:21
source share
3 answers

The answer is here , I think.

Better if you use git rm .

+54
Oct 20 '12 at 11:24
source share

Use git add -A , this will include deleted files.

Note: use git rm for specific files.

+43
Oct 20 '12 at 11:25
source share

It says directly on the output of git status :

 # (use "git add/rm <file>..." to update what will be committed) 

so simple:

 git rm <filename> 
+24
Oct 20 '12 at 11:24
source share



All Articles