tags:

views:

80

answers:

3

I want to remove everything inside my git project. Is there any easy way to do this?

+4  A: 

Yeah. Just like you can add everything.

git rm -r .
Damien MATHIEU
I'm getting "fatal: pathspec '' did not match any files" on Linux/Windows. Do you have any idea?
pocoa
I saw that my working folder is empty now. So it worked now? What a stupid error message!!My local copy is ok now. But what about the original copy on the server. Do I need to something else?Sorry, I red lots of documents but it's still confusing me.
pocoa
To empty the remote repo, you need to commit that. `git commit -m "you all, go away"` and then push. `git push`
Damien MATHIEU
+2  A: 

Sure:

rm -rf /path/to/gitrepo

Or did you mean 'Remove all files in the project from content tracking'?

git rm -r /path/to/gitrepo
git commit
MikeyB
Yeah, I want them to be accessible in the previous version. But the new version shouldn't have them.
pocoa
+2  A: 

If you want to completely remove the repo from GitHub, there is "Delete this repository" option for that on the project admin page. The URL is typically something like:

https://github.com/<username>/<project>/edit

If you want to remove the files from the next revision of the repo, but keep their histories, then you should do something like:

git rm -r .

If you only want to eliminate the history of certain files in the repo, you can use git filter-branch.

Tim Henigan
No, I still want to keep those files in previous version. But the new version will not have them.
pocoa