61

I am wondering what the proper way is to delete a repository when using gitolite.

Is there anything else I have to do besides delete the repository from the server and remove all configurations related to the repository I am removing?

Potherca
  • 13,207
  • 5
  • 76
  • 94
ryanzec
  • 27,284
  • 38
  • 112
  • 169

3 Answers3

89

Deleting the repository from the server and removing all configurations is all you have to do.

Quoting from the manual:

Removing a repo is not so straightforward. You certainly must remove the appropriate lines from the conf/gitolite.conf file, but gitolite will not automatically delete the repo from the server. You have to log on to the server and do the dirty deed yourself :-)

It is best to make the change in the conf file, push it, and then go to the server and do what you need to.

kraftner
  • 467
  • 2
  • 19
Potherca
  • 13,207
  • 5
  • 76
  • 94
  • 8
    +1 for referring to the manual and quote the suggested steps. – Raymond Tau Oct 07 '13 at 04:10
  • Is there anything else that needs to be done apart from editing the conf file and deleting the repository folder from the server? – Stan Dec 12 '13 at 09:51
  • 1
    @Stan Well, to be precise, you would have to `git add`, `git commit` and `git push` the config file to the remote repository after you are done editing. – Potherca Dec 12 '13 at 10:58
  • 4
    +1 for explaining ***why*** "that's all you have to do", instead of plainly saying "that's all you have to do". – Amal Murali Feb 02 '14 at 14:30
41

Nope! That's all you have to do!

Artusamak
  • 2,470
  • 19
  • 19
6

Actually there is another more formal way to do this through the Apis. This is a more practical way when giving away to users the privilige to create their own repos (wild repos).

This requires:

  • Admin enables the D command by removing the appropriate commented line (on the server) in $HOME/.gitolite.rc
  • Unlocking the repository (safety procedure) "ssh gitolite@hostname D unlock reponame"
  • Deleteing the repository with "ssh gitolite@hostname D rm reponame"

Some simple documentation can be found in the Gitolite docs but the documentation is better in the book "Gitolite Essentials".

Lmickos
  • 369
  • 3
  • 10
  • Isn't this just for "wild" repos? – Potherca Sep 05 '14 at 11:46
  • Actually it seems to work for both but is sorely needed when create privs are given as freely as when using wild repos. – Lmickos Sep 08 '14 at 17:06
  • +1, Just small addition- before you do it you need to make sure to uncomment 'D' command in .gitolite.rc file in Gitolite host so this command is enabled – Omer Dagan Jan 29 '19 at 08:03