Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I rename a Git repository created with gitolite?

Tags:

git

gitolite

I created a Git repository using gitolite. Now I would like to rename that repository.

How can I do this?

In gitolite's readme is says that I should not work directly on the server. But I guess I have to do some work on the server in this case, right?

like image 901
Patrick Avatar asked Jan 16 '11 22:01

Patrick


People also ask

How do I change the name of my git repository?

Select the repo you want to rename under Git repositories on the left and select .... Select Rename repository... from the menu. If the Repositories pane is not expanded, select > to expand it and display the list of repositories. Enter a new repo name in the Repository name field in the dialog, then select Rename.

What is Gitolite in git?

Gitolite allows you to setup git hosting on a central server, with fine-grained access control and many more powerful features.

How do you use Gitolite?

Set up the gitolite environment on the git server This command ssh to the git server as root and does the follows. First, as root, create the user for hosting git. Then, as the git user, clone the gitolite from github, install it to ~/bin/ and set up the gitolite. And the gitolite git server is set up successfully.

How do I clone Gitolite?

Run git clone git@server:gitolite-admin . Obtain pubkeys from each user; email, USB, DHL, pigeon post, owl mail, any method you like. Rename each received file to the name of the user, add a ". pub" at the end, copy it into keydir/ in the gitolite-admin repo you cloned.


2 Answers

As stated in the gitolite basic-admin manual:

renaming a repo

This is similar; there's no code to do this in gitolite. What you do is:

  • log on to the server, cd $REPO_BASE (default: cd ~/repositories), and

    mv old-name.git new-name.git

  • back on your gitolite-admin clone, edit conf/gitolite.conf and replace all occurrences of old-name with new-name. Then add, commit, and push as usual.

The order of these 2 steps is important; do not reverse them :-)

A third step is necessary on gitolite3:

  • edit file gl-conf in the repo and change the repository name to the new name

And of course, every user should update his clone configuration to point to the new repo name.

like image 113
takeshin Avatar answered Sep 20 '22 12:09

takeshin


I'm not familiar with gitolite specifically, but one approach that might work is to create a completely new repository with the correct name, push your code up into that one, and then delete the old one.

like image 41
Greg Hewgill Avatar answered Sep 19 '22 12:09

Greg Hewgill