Wednesday 7 April 2010

github project howto: fork, clone, modify, request merge

I use the searchlogic gem by binarylogic for report search filters and it works great, but unfortunately it doesn't support the rails datetime_select helpers. The issue has existed on github for many months, and one user even offered a nice gist to fix the problem. Many months later and it still has not found its way into searchlogic master. So I figured its time to give back to the open source community by making it as easy as possible for Ben to incorporate the fix.

1. Fork the project on github http://help.github.com/forking/

2. Clone your fork.
2.1 If you have never done this before, you'll have to upload a private ssh key to github first. See http://help.github.com/mac-key-setup/
2.2 Then you can clone your newly-forked version of the project:

git clone git@github.com:philrosenstein/searchlogic.git

3. Run the tests. In my case I provided a relative path to spec in my rails project.

../path/to/script/spec ./spec/search_spec.rb -c

4. Make the changes locally. Using your favorite editor of course.

5. Run the tests again to make sure you haven't broken anything. You should also add new test cases if you have added functionality.

6. Commit the changes.

7. Request a merge from the project owner. If you are confident in your changes and they will make the project better for others, this is where you give back to the community that your projects have benefited so much from!

No comments:

Post a Comment