I have a folder called "Serverside Project" that I want to delete from my git repo online. I can't seem to be able to get rid of it! How do I remove it?
Asked
Active
Viewed 8.7k times
1 Answers
47
You can just delete the folder locally and then push, ex:
rm -rf folder
git add .
git commit -a -m "removed folder"
git push origin master

Mauricio Trajano
- 2,677
- 2
- 20
- 25
-
2The problem is I have deleted the folder on my local drive which is at another location but the folder is still in my online repo, so I want to delete the folder 'Serverside Project' from my online repo then pull all the other folders and files that are on my online repo atm. – ifusion Nov 10 '14 at 06:55
-
1Oh I see, then why don't you clone the repo delete the folder then push? – Mauricio Trajano Nov 10 '14 at 06:57
-
7
-
I tried doing that and this is what I got: `$ git rm -r Serverside Project` `fatal: pathspec 'Serverside' did not match any files` – ifusion Nov 10 '14 at 07:08
-
5Spaces are treated as separate arguments do `git rm -r Serverside\ Project` – Mauricio Trajano Nov 10 '14 at 07:10
-
2
-
@Chris Maes - thanks. yes and my repo was still in the local cache - was able to remove it via https://stackoverflow.com/a/7927283 - it then removed it from the server after push – SpeedCoder5 Mar 01 '18 at 14:55