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: | 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.


  • Titanous
    In step 3, something like this would be faster:
    sed -i 's/tk.git/show-time.git/' .git/config
blog comments powered by Disqus