tags:

views:

150

answers:

2

My Git repository is on the server and I need to...

  • restore the repository
  • remove logs / history
  • remove all files

How could I do it? Thank you.

A: 

You could ssh into the server, go to the directory, make sure you are where you expect, and delete it with "rm -rf $path".

florin
But I don't have access to the server, only to the Git repository.
Blagun
make sure not to do the similar command `sudo rm -rf $PATH` :)
Peter
-1 I seriously hope you meant `rm -rf .`
Tobias Kienzler
A: 

You might be able to git push origin :<remote branch name> for every single remote branch. This will delete all remote branches and eventually the old object db will probably be cleaned up.

To do this in a bash one liner execute something like this: for i in $(git branch -r | grep origin | sed 's#origin/##'); do git push origin :$i; done. I haven't tried this, nor do I want to.

Where exactly is this repo hosted that you don't have ssh access and can't delete it through some other method (github, et al should have some way of deleting them manually)?

Xentac