Dr Nic

Git for Rubyforge accounts

rubyforge has git - account creation

First there was CVS, then came SVN to RubyForge. Actually, I’m guessing that CVS was the sole SCM initially, and SVN was added later. I just can’t imagine them starting RubyForge from scratch and explicitly saying “yeah we’ll offer CVS because …”. I don’t know how that sentence would have finished. It must have been added first. There is no valid “because …”.

But now, with each RubyForge project there is a Git repository. This is great for two very good reasons:

  1. the end is nigh for empty or unmaintained SVN repositories
  2. less centralised decentralised development

GitHub + Gitorious are the go-to-guys for somewhere to hang your proverbial hat: somewhere you push your local git repository to so other people can access it.

Yet when I’m investigate someone’s new RubyGem or other project, the first place I look for its source is RubyForge. I assume the project name is the same as the gem name, and goto http://rubyforge.org/projects/pastiepacker for example.

rubyforge scm link

Then I click on the SCM tab. Normally this gives SVN instructions. In this modern era, many projects SVN repos can now be blank or unmaintained with Git repos being preferred by many.

So, the reason to push your git repository to RubyForge’s new git system is to make life easier for me. I mean, I don’t know who else clicks on the SCM link, but I do.

While this is all well and great for new projects – you can select “git” instead of “svn” as per the first image above – but I’m not yet sure how to migrate old projects [follow support ticket].

The other reason is to actually help your distributed repository be distributed. Push it to github. Push it to gitorious. And now you can push it to rubyforge. Sweet.

Adding another remote repository

Since your default remote repository is probably called “origin”, you may wonder how such a naming schema could ever expand to multiple remote repositories? Might I suggest “rubyforge” as the name of the rubyforge repository?

git remote add rubyforge gitosis@rubyforge.org:pastiepacker.git
git push rubyforge master
git push origin master

If you do this for all your projects, perhaps a bash script is in order:

function gpall() {
  git push rubyforge master
  git push origin master

One project equals one repository, but multiple packages

Using a Rubyforge project’s git repository might be problematic where you release multiple packages/rubygems (codeforpeople, seattlerb, mongrel, drnicutilities, etc). Here I’d prefer one repository per package, rather than one repository for the whole “project”.

Perhaps you could push the master branch from your local repository for each package into different branches of the rubyforge git repository. Thoughts?

Can’t push to your rubyforge git repo?

From the FAQ:

RubyForge Git repositories are managed via gitosis; gitosis does authentication via public keys. This means that in order to push to a RubyForge Git repository you’ll need to upload a public key to your account – see notes on that here.

Generally, Git support is something we’ve just introduced, so feedback about it on the forums would be quite welcome.

What is Pastie Packer?

I can’t tell you. Its a secret.

Related posts:

  1. GitHub and TextMate Unite I wanted to go from a source file to the...
  2. Using Git within a project (forking around) In Star Wars, when Grand Moff Tarkin orders the...

27 Responses to “Git for Rubyforge accounts”

  1. [...] vi primeiro no blog do Dr Nic, e resolvi conferir. Pois é, o Rubyforge agora também aceita projetos em Git. É… não tem [...]

  2. Johan S says:

    Yay! Git is the new svn

  3. Jon Garvin says:

    Thanks for the post.

    What about projects already on Rubyforge using SVN. Is it possible to migrate them to Git? Is this even advisable or should they stay put?

    Also, a future post describing how a Rails project managed in SVN can install and manage external plugins hosted on Git (and visa-versa) would be appreciated? Is this even possible? I honestly have no idea.

  4. Dr Nic says:

    @ALL – OpenID on site is sort of broken – your comment should be submitted, but you might be shown a blank page. Go back, reload, and see if comment is there.

    Working on a fix. I killed the php.log file and now no log is going there. I guess i need to get TextDrive to restart apache or something. Bah.

  5. Alex Soto says:

    @jon – haven’t tried it myself but you should check out braid

  6. cypher says:

    If you have one project but multiple packages, you can try using git-submodule. You’d still need repos for each individual package, but with GitHub and Gitorious around, that shouldn’t be too much of a problem.

  7. [...] Git for RubyForge Accounts – Dr. Nic explores. [...]

  8. Trevor Turk says:

    Done and done. Thanks for the tips, Dr Nic!

    You can grab my project off of RubyForge very easily, even though it’s real home is at github:


  9. James Zhuo says:

    So what are the strength of Git compared to say SVN? To me SVN works really well and I see no real reason to move to Git unless if there are compelling enough reasons to do so.

  10. Dr Nic says:

    @James Zhuo [via] – for me it was git-svn initially, so I could take my repos offline. Then I found git ideal for the process of updating the rails textmate bundle with so many contributors + so many new files. Much easier on me and on contributors.

    As a contributor to other ppls’ projects it is so easy to have your own repo locally and/or a remote clone/fork, and not have to wait patiently for patches to be accepted or not, whilst leaving your svn status report showing a dozen notices of new/missing files.

    My workflow for working on commerical + open source process, both mine + other peoples, has improved significantly. Except when I hit gitcups. Hiccups in living with git where you’re forced to learn another of the 150 git-* operations or the dozen options they each have. But its a happy price to pay :)

  11. Aman Gupta says:

    Any way to convert an existing project?

  12. Dr Nic says:

    @Aman Gupta [via] – the current method (discussed here) is to raise a ticket on the Rubyforge support forum asking for your svn repo to be closed down and a git repo created. So you’ll need to have git-svn’d your repo already before asking this, or things might get nasty for you :)

  13. Dr Nic says:

    Ok, here’s a step-by-step guide to converting SVN -> Git repository on Rubyforge:

    rubyforge - converting from svn to git
    Uploaded with plasq‘s Skitch!
  14. james says:

    One comment about Rubyforge: Great site but navigation is very confusing b/c projects “docs” links never contain any docs!

  15. Jon says:

    Hey Dr. Nic,

    I just shot you an email and got this response:

    “I am offline til Tuesday 27th November. See you then.”

    Seriously? If so, well done, that’s a nice long break from the digital grindstone. :)

  16. Dr Nic says:

    @jon – heh, no that was wrong. I’m sure I changed the date in the message when I turned on the Holiday Autonotification. I’m back from holidays and back on the grindstone :)

  17. [...] to Dr Nic Williams for highlighting this at such an awesome time. I’ve got the source for [...]

  18. simmel says:

    I like automagic especially when it works the way I want it to and when I just have to configure stuff once. This is how I publish my stuff at both gitorious and rubyforge http://pastie.caboo.se/194848

  19. Dr Nic says:

    @simmel – oh that is very cool, thx!

  20. For some reason, I had to do my escape a bit differently:

  21. [...] At first I found it funny that even though they were moving to a distributed version control system, everyone decided to keep their repositories in the exact same place. Being distributed, a Git repository doesn’t need to be hosted unless you’re sharing it. You can publish it easily on any web server, and RubyForge (which has always been the most popular place to host Ruby projects) supports git. [...]

  22. elliottcable says:

    Regarding your little bash script… there’s a much easier way. You can actually add multiple url configuration entries for each git remote in the config file, as I describe here:


    (Gist’s still having trouble with its embed code, so here’s a direct link to the code that should show up on that page: http://gist.github.com/2015)

  23. [...] sure if posting gems via GitHub is sufficient, I’ve registered a new project on RubyForge. They now support Git too, which makes it super easy to push my changes to both “hubs”. So, you will most [...]

  24. Turk Admin says:

    Thanks for the tips, Dr Nic!
    See you