technicalpickles

Open Source ProjectsCode that Might be Useful to You

Talks I've GivenOn Technologies and Ideas

ThoughtsWhere I Sometimes Write Things

Resume If You Still Believe In Those

Follow Me On

GitHubIf coding is your thing

TwitterIf you tweet

GitHub: Forking a project


If you hadn’t heard, GitHub went officially live last week.

As I’ve posted before, git is pretty awesome. GitHub makes it even better.

In honor of the launch, here’s a quick rundown of forking a repository to start hacking away.

First off, you need to find a victim. In this case, I’m going to go after thoughtbot’s Shoulda.

First navigate to the repository, and click ‘fork’.

Give it minute while the hardcore forking action happens. Now you have your own fork of the repository.

Here you can see your clone/push URL. So we should go ahead and clone it:

git clone git@github.com:technicalpickles/shoulda.git

So we have a checkout now. As is, it’s kind of detached from the official repository. If we’re going to be actively working on it, we should add the official repository as a remote.

cd shoulda
git remote add official git://github.com/thoughtbot/shoulda.git

From now on, we should be able easily pull in the changes:

git pull official master

So now what? Get hacking of course. But how do send our changes back? Well, this is a tricky question. There are several ways, but it mostly depend on those receiving the changes back. As people get more comfortable with git, I think we’ll start to see some best practices emerge here.

comments powered by Disqus