Rename A Gitosis Repository
Posted: May 28th, 2009 | Author: Jerod | Filed under: Git | Tags: gitosis | View CommentsI use gitosis for private git repository hosting (and it’s awesome). If you are interested, this great tutorial will walk you through setting it up yourself.
I recently needed to rename one of my repositories and couldn’t find any info on how to do it, so here is a walk-thru. I will demonstrate the steps of renaming a repository called “tk” to “show-time“.
- Rename project in gitosis.conf and push changes
- Connect to gitosis server and rename correct folder
- Change the remote reference in all repository clones
Before:
[group main] writable = tk
After:
[group main] writable = show-time
git push origin master
cd /home/git/repositories mv tk show-time
cd /src/show-time git remote rm origin git remote add origin git@example-git-server.com:show-time.git
Done and done.
In step 3, something like this would be faster:
sed -i 's/tk.git/show-time.git/' .git/configIn step 3, something like this would be faster:
sed -i 's/tk.git/show-time.git/' .git/configWorks a treat for normal gitosis repositories, thanks
I wanted to rename the gitosis-admin repository, since Ive a few gitosis setups on different servers
In this case theres one final step to do
Go onto the gitosis server, and cd to the home directory of the git user
Then youll see a symbolic link form /home/git/.gitosis.conf –> /home/git/repositories/gitosis-admin.git/gitosis.conf
Remove this symlink and re-add it to point to the renamed gitosis repo
ln -s /home/git/repositories/NEW-GITOSIS-REPO-NAME.git/gitosis.conf ./.gitosis.conf
Thanks! Just what I needed.
thanks for t his
Hi there, I set up your blog via Google while searching in the routine of gold medal subsidize on the side of a heart against and your condensed looks very thought-provoking seeing that me