Rails on the Run

Rails experiments by Matt Aimonetti

Browsing Posts tagged github

Github, probably the most famous social code hosting service just redesigned their homepage and are now featuring hosted projects.

I got a very good surprise when Takeo from Powerset & Stafftool hall of fame mentioned to me that Github picked one of my gems as the first featured project!

github

By the way, Takeo is also a Googlecharts contributor (+ a Merbist) and I had the honor to be the first one he ever forked!

Another Googlecharts user, Mokolabs from Graffletopia and iCal Share also decided to try Git and Github. In no time he had forked my project, made some modifications and sent me a pull request. w00t w00t!

To celebrate, we released version 1.3.4 with cleaner documentation, and enhanced features.

Documentation & Code Repo

Thanks to everyone involved in this project. And special kudos to the GitHub team for offering such an awesome service!

If you don’t know about git and github yet, it’s time you clean up your RSS feeds and find some good source of information.

Github is used by the Merb core team and I’ll show you how to use github to fork Merb, make your modifications and “submit your patch”.

This is the exact reason why github is simply awesome, it makes forking projects just super simple and submitting changes even easier.

First thing, you need to have a github account, if you don’t have one yet, email me, I have a couple of invitations left, otherwise, just wait until github gets public.

Now, let’s go to Merb’s repository and fork Merb-core by clicking on the fork button.

fork merb

Actually, for this example, I’ll fork merb-plugins because I want to improve the ActiveRecord rake tasks.

Because I forked merb-plugins, I now have my own forked repo: !my forked repo

I’ll start by checking out/cloning my forked repo locally.


git clone git@github.com:mattetti/merb-plugins.git

!git clone

Great I can now make my own changes…. but wait, what if the merb core team makes a change to the code? Well, I need to track their changes. Here is how:


git remote add coreteam git://github.com/wycats/merb-plugins.git

FYI, it adds the following to edit .git/config:

1
2
3
4

  [remote "coreteam"]
  url = git://github.com/wycats/merb-plugins.git
  fetch = +refs/heads/*:refs/remotes/coreteam/*

then


git fetch coreteam

and finally


git checkout -b coreteam coreteam/master

You can now track the latest change and merge them with your branch. Note that you can also track other forks and merge some other changes. (just that feature is worth using git)

Alright, now you can do your stuff, and push your local change to your remote repo at github.

Once you are done, you can simply click on the “pull request button”

pull request button

fill up the form and select the recipient. (wycats in this example if you want him to merge your changes into the official version of Merb).

pull request

p.s: The github guys are working on a gem to make our loves easier, give http://github.com/defunkt/github-gem/tree/master a try. I’ll post about the gem when it will be a bit more stable.