Gitolite – Delete wild repositories

Wild repositories in gitolite are a very convenient way of managing lots of small repositories with the same permissions. Users with the C permission can easily create a repository by cloning one that matches the defined repository-regex.

To delete a wild repository multiple steps are required (details below):

  1. Per server: Activate the gitolite command D
  2. Per repository: Unlock the repo for deletion
  3. Per repository: Delete the gitolite repo

Activate the gitolite D command

For the first time you need to make sure that the gitolite D command is activated on the server (which is not the case by default).

ssh gitUser@myserver
nano ~/.gitolite.rc

Uncomment the D command in the ENABLE block to activate it.

Unlock the gitolite repo for deletion

Check the -D usage using ssh gitUser@gitServer D -h and use the suggested commands:

ssh gitUser@gitServer D unlock myRepo

Delete the gitolite repo

Decide if you want to delete it immediately (rm) or retain recovery options for some time (trash).

ssh gitUser@gitServer D trash myRepo
ssh gitUser@gitServer D rm myRepo

 

Using these steps you can easily create unused or old gitolite repos on the server.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: