Top Banner
Contributing to an Open Source project on GitHub Andy Waite June 2012
17

Contributing to Open Source via GitHub

Apr 14, 2017

Download

Software

andyw8
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Contributing to Open Source via GitHub

Contributing to an Open Source project on GitHubAndy Waite June 2012

Page 2: Contributing to Open Source via GitHub

Why contribute?Learn a technology outside of your day job

Scratch an itch

Remove a blocker

Learn by peer review

Collaborate and share knowlege

Promote yourself and get noticed

Your portfolio is your CV

Coderwall

Page 3: Contributing to Open Source via GitHub

What to contribute?

Fix a bug for a problem you’ve discovered

Add behaviour for a new feature you want

Resolve an issue reported by someone else

Improve the documentation (what confused you?)

Expand the test coverage

Provide a example

Page 4: Contributing to Open Source via GitHub

The old way

Mailing lists, FTP servers

diff oldFile newFile > mods.diff

patch < mods.diff

SourceForge

Page 5: Contributing to Open Source via GitHub

The new way

GitHub - founded in 2008

Now over 1.7 million users, 3 million repos

Code, issues, wiki, hosting, stats, social, API

Major projects: Node, Rails, jQuery, Backbone, Linux Kernel, PHP, Zend 2, Symfony, Underscore, Git, Wordpress, Drupal

Big companies: Google, Microsoft, Apple

All free for public projects

Page 6: Contributing to Open Source via GitHub

Getting started

Create a GitHub account

Setup Git

Identify the original project (beware of forks)

Check for signs of life

Page 7: Contributing to Open Source via GitHub

Fork the original project

One click to fork into your account

andyw8/WidgetMagic → samfrench/WidgetMagic

Clones the full history, branches, tags

Page 8: Contributing to Open Source via GitHub

Clone your fork locally

git clone [email protected]:samfrench/WidgetMagic.git

cd WidgetMagic

Page 9: Contributing to Open Source via GitHub

Run the test suite

Install the dependencies

Run the test suite

Common language conventions:

Ruby: rake

Java: mvn

Page 10: Contributing to Open Source via GitHub

Create a topic branch

Use one branch per topic (bug, feature, etc.)

git checkout -b allow-duplicate-widgets

Display the current branch in your shell prompt

Page 11: Contributing to Open Source via GitHub

Commit your change

git add WidgetMagic.rb

git commit -m "Allow duplicate widgets"

Page 12: Contributing to Open Source via GitHub

Push to your remote repo

git push origin allow-duplicate-widgets

Page 13: Contributing to Open Source via GitHub

Create a pull request

Pull Request button appears on your repo

A pull request starts a conversation

It might not be accepted right away

Improve it and push the new commits

Page 14: Contributing to Open Source via GitHub

Merging the pull request

Project maintainer merges your commits and closes the pull request

GitHub sends you an notification

Your contribution shows in the commit log

Page 15: Contributing to Open Source via GitHub

Stay up-to-dateA few months later you want to contribute again

But changes to the original project don’t propogate automatically so your fork becomes out-of-date

git remote add upstream git://github.com/andyw8/WidgetMagic.git

git fetch upstream

get merge upstream master

Page 16: Contributing to Open Source via GitHub

Social coding

Promote your contribution

Maintainers - thank your contributors

Page 17: Contributing to Open Source via GitHub

In summary

Start with the smallest contribution you can find, e.g. fixing a typo

Share half-formed ideas. Code is better than words.

Start your own project!