Skip to content

Contributing to a project on Github

December 24, 2009

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/

6 Comments leave one →
  1. brian d foy permalink
    December 25, 2009 4:38 am

    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. 🙂

    • December 25, 2009 11:21 am

      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/

  2. rob permalink
    December 27, 2009 6:29 am

    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.

    • December 28, 2009 1:26 pm

      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/

  3. May 6, 2010 5:49 pm

    Thanks for posting this – was surprising how everyone assumed it was known and was difficult to figure out the first time 🙂

Leave a reply to draegtun Cancel reply