Delete files on Git Server

Git is one heck of a tool for maintaining source code base. I’ve been using it for a while and loving it more than SVN and VSS.

Recently I had a problem where I had to remove some files locally. I removed unnecessary classes and pushed the code to Git server. Everything works fine but the deleted files are still exists in the server. So when I do the pull command form another machine, I’ll still get the deleted files.

After digging around for a while I come to know that running following command will remove unnecessary deleted files from server as well.

Run add as below

$ git add . -A

Now commit and push it

$ git commit -m "removed some files"
$ git push origin master

That’s it, now check your files in the server.

Did you enjoy this article?
Signup today and receive free updates straight in your inbox. We will never share or sell your email address.


  1. Hey mayu! I am just starting work with Git after working with Svn for a long time. Surprised that you like it better than Svn! Any tips for a beginner in Git?

  2. @Harini
    Hey good to hear from you after long time. Changing from one tech to another is mostly painful. I hope you are going through that right now. But no worries, there are good Git video tutorials online that can help you get started. I really like it because, you always have a backup not only in server also locally. You don’t necessarily have to be connected to your GIT server to commit your changes. You always commit to your local repo first then push it to server. That is something awesome :)


Leave a Reply