Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Your first PR: contributing to open-source software

Your first PR: contributing to open-source software

Lightning talk given to NomadPHP EU May 2016.

Gareth Ellis

May 19, 2016
Tweet

More Decks by Gareth Ellis

Other Decks in Technology

Transcript

  1. Your  first  PR:  contribu0ng  to  open-­‐source  projects  
    Gareth  Ellis  (@garethellis)  
    Developer,  Language  Services,  ICON  plc  
    For  NomadPHP,  May  2016  

    View Slide

  2. Who  am  I?  
    •  Developer,  Language  Services  group,  
    ICON  plc  
    •  Professional  developer  since  2013  
    •  Co-­‐founder/organizer  PHPOxford  
    •  Occasional  contributor  to  open-­‐
    source  projects  

    View Slide

  3. Why  should  I  contribute?  

    View Slide

  4. Give  something  back  
    It’s  the  circle  of  life  open-­‐source  soZware  

    View Slide

  5. Self-­‐improvement  
    Exposure  yourself  to  new  codebases,  techniques  and  pa]erns.  

    View Slide

  6. Fun!  
    “It’s  good  for  the  soul”  
    Nils  Luxton  (@nilsluxton)  

    View Slide

  7. What  can  I  contribute?  

    View Slide

  8. Iden0fy  a  project  
    What  do  you  use  regularly  that  could  benefit  from  some  
    improvements?  

    View Slide

  9. Types  of  contribu0on  
    Submit  an  issue  on  Github  
     
    Answer  a  ques0on  on  StackOverflow  
     
    Documenta0on  
     
    Blog  post  
     
    Code!  

    View Slide

  10. Contribu0ng  to  source  code  
    Changes  can  be  big  or  small  

    View Slide

  11. Contribu0ng  to  source  code  
    The  project  may  have  already  iden0fied  a  gap  –  can  you  help?  

    View Slide

  12. How  do  I  contribute?  

    View Slide

  13. Before  you  begin!  
    Consider  discussing  what  you  want  to  change  with  the  project  
    maintainers.  

    View Slide

  14. CONTRIBUTING.md  
    Read  the  contribu0ng  guidelines.  

    View Slide

  15. The  process!  
    1.  Fork  
    2.  Clone  
    3.  Branch  
    4.  Change  
    5.  Commit  
    6.  Push  
    7.  Submit  Pull  Request  
    8.  Review  

    View Slide

  16. Fork  

    View Slide

  17. Clone  
    $  git  clone  [email protected]:garethellis36/cakephp.git  
    $  cd  cakephp  
    $  composer  install  

    View Slide

  18. Clone  (2)  
    $  git  remote  add  upstream  [email protected]:cakephp/cakephp.git  

    View Slide

  19. Branch  
    $  git  checkout  –b  my-­‐awesome-­‐new-­‐feature  

    View Slide

  20. Make  your  changes  
    Follow  contribu0on  guidelines  
    Write  tests  as  necessary  

    View Slide

  21. Commit  and  push  
    $  git  add  src/Folder/AnotherFolder/ChangedFile.php  
    $  git  commit  –m  “Here’s  a  descrip0on  of  this  awesome  new  feature”  
    $  git  push  –u  origin  my-­‐awesome-­‐new-­‐feature  

    View Slide

  22. Submit  the  Pull  Request!  
    Screenshot  used  with  permission  of  Rob  Allen  

    View Slide

  23. Submit  the  Pull  Request!  (2)  
    Screenshot  used  with  permission  of  Rob  Allen  

    View Slide

  24. Review  
    Discuss  your  PR  with  the  project  maintainers  
    Make  changes  if  necessary  
    To  add  changes  to  your  PR,  simply  change,  commit  &  push  

    View Slide

  25. Further  reading:  
     
    Find  projects  to  contribute  to:    
    h]ps://yourfirstpr.github.io/    
    h]p://issuehub.io/  
    h]p://up-­‐for-­‐grabs.net/  
     
    Joind.in:  h]ps://joind.in/about    
     
    h]ps://akrabat.com/the-­‐beginners-­‐guide-­‐to-­‐contribu0ng-­‐to-­‐a-­‐github-­‐project/  
    (Rob  Allen)  
     
    h]p://www.lornajane.net/posts/2015/code-­‐reviews-­‐before-­‐you-­‐even-­‐run-­‐the-­‐code  
    (Lorna  Mitchell)  
     

    View Slide

  26. Thanks  for  listening.  
     
    h]ps://joind.in/talk/c5551    
     
    [email protected]  
    @garethellis  
    h]ps://blog.garr.co.uk  
     
     

    View Slide