Insights on Ruby, Git, jQuery, Cappuccino, WordPress, Debian and OS X. Please subscribe if you find something useful!

Rename A Gitosis Repository

Posted: May 28th, 2009 | Author: Jerod | Filed under: Git | Tags: | View Comments

I 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“.

  1. Rename project in gitosis.conf and push changes
  2. Before:

    [group main]
    writable = tk

    After:

    [group main]
    writable = show-time
    git push origin master
  3. Connect to gitosis server and rename correct folder
  4. cd /home/git/repositories
    mv tk show-time
  5. Change the remote reference in all repository clones
  6. cd /src/show-time
    git remote rm origin
    git remote add origin git@example-git-server.com:show-time.git

Done and done.


View Comments on “Rename A Gitosis Repository”

  1. 1 Titanous said at 5:16 am on May 29th, 2009:

    In step 3, something like this would be faster:
    sed -i 's/tk.git/show-time.git/' .git/config

  2. 2 Titanous said at 12:16 pm on May 29th, 2009:

    In step 3, something like this would be faster:
    sed -i 's/tk.git/show-time.git/' .git/config

  3. 3 Carpii said at 2:47 am on May 31st, 2010:

    Works 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

  4. 4 techiferous said at 2:07 am on August 2nd, 2010:

    Thanks! Just what I needed.

  5. 5 Digitalfoo dot net said at 3:58 pm on August 3rd, 2010:

    thanks for t his

  6. 6 albuterol sulfate said at 3:18 pm on August 28th, 2010:

    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

blog comments powered by Disqus