Contributing to a project on Github
After getting my head into Devel::Declare::Context::Simple to create the bare URL for my last blog post
I realised that I’ve percolated enough knowledge about the module that it would be a good idea to redirect it back to the project by at least doing the POD.
This will be the first time I’ve “properly” contributed in some form to an opensource project (“properly” being via source control management & a patch).
Devel::Declare is hosted on Github here. And the process to contribute back changes to a Github project is “forking” simple!
With Git & Github its all about forking. Here is a concise Github howto (which I’ll regurgitate below with my own slant & spiel!).
I only use Git for my Github projects, so forking etc is all new to me. To break it down into a few simple steps the process to contribute would be:
- Fork project
- Clone your fork
- Make your changes
- Push changes back to you fork
- Send pull request back to original project
Here are the minutiae steps I went through for Devel::Declare:
- Went to Devel::Declare project on Github and forked it.
- Forked project now appears in my project list.
- Cloned my forked Devel::Declare (use “Your Clone URL” copy/paste)
git clone git@github.com:draegtun/devel-declare.git
cd devel-declare/
- Linked my forked project to original
git remote add upstream git://github.com/rafl/devel-declare.git
git fetch upstream
- Make my changes to project
- Run tests (in case I did something stupid!)
perl Makefile.PL
make
make test
- Clear down build once happy
make realclean
- Push my changes back to my fork
git commit -a -m "Documentation added to D::D::Context::Simple + examples directory"
git push origin master
Now on Github the changes can be seen in my fork
All I do now is click the “pull request” button and off went a request of my changes to rafl. Fingers cross my documentation changes were good enough to be accepted.
So I’m no longer a virgin to contributing to this opensource malarky π
/I3az/
Github makes it even easier than that if you want to make a quick fix like a spelling change. You can fork, then edit the file directly in Github. You never have to install git, clone, and so on. It’s actually pretty cool that I can be at someone else’s computer and fix stuff as long as I have a web browser. π
Great point brian. I think Iβve seen Beppu do or mention this on one of his own Github projects. Its certainly a really useful feature that Github provide.
/I3az/
Just for your interest, I have been working on some sugar for DD.
http://github.com/robinedwards/Keyword
Still just experimenting with ideas, however there is an example there of bare SELECT statements.
Hi Rob,
Very nice! Always partial to a bit of sugar with my tea π
Some interesting experimenting going on there… looking forward to see how it pans out.
/I3az/
Thanks for posting this – was surprising how everyone assumed it was known and was difficult to figure out the first time π
Hi Brian,
Your very welcome. Glad its been helpful in some way.
regards Barry
PS. I see this post as gained extra eyeballs today because its currently on front page of Hacker News: http://news.ycombinator.com/item?id=1324592 π