How to Use GitHub to Contribute to Open Source Projects

I have been a fan of open source software for many years now. Not only do I use open source software, but I also develop a bit myself. A few years ago, a version control system by the name of Git wandered out from Linus Torvalds’ workshop. Its popularity boomed, especially when a little start-up known as GitHub sprang up. GitHub is a service that hosts Git projects for you, both public (that is, open source) and private. Over the years, however, it has also expanded to provide users with features such as code review, bug and feature ticketing, and a wiki system for hosted projects. If you have ever wanted to get involved with open source software, but were not quite sure on how to get started, GitHub is a great place to start.

A Quick Guide to Git

Before I go into detail about ways you can contribute with GitHub, I figured many readers would appreciate a brief overview of Git itself. If you would like a more in-depth guide to learn more about Git and how to use it with GitHub, I would suggest visiting GitHub’s excellent Help site. If you just want a quick primer, continue reading this section.

So, Git is a version control system. What’s that? Let’s say you were working on a large project with many developers. If everyone edited the project’s source code at once, there would be tons of conflicts and it would be hard to make sense of things. With version control, specifically Git, each developer makes changes to a local copy of the project, makes a commit, and pushes that change to a remote location if the project is hosted on an external server such as one of GitHub’s. Every change made under a version control system is tracked, so conflicts are greatly reduced and any you do encounter can be sorted out fairly easily.

The basic Git work flow is this:

  • git init will create an empty Git repository in the current directory or a directory you specify. If you want to work on an existing repository that lives at a remote location, use git clone.
  • To make sure you have the latest version of the repository (if you cloned from a remote, upstream location), use git pull.
  • After adding new files or making changes to existing ones, add your changes with git add.
  • Commit and describe your changes with git commit.
  • Use git push to send your changes to a remote location, such as GitHub.

As you can see, I linked each command to a respective area on GitRef.org, another excellent site for learning Git.

One final thing I really recommend is that those aspiring to make their lives easier with Git watch the following talk. It’s roughly an hour long, but it’s got great information. On top of that, it’s given by one of the founding employees of GitHub.

Anyway, it’s time to move on to the real topic at hand here: utilizing GitHub to make your contributions to open source software.

Contribute Code

Know a programming language or two? Fancy solving a problem or creating something awesome? One of the simplest ways you can contribute to open source software is to, of course, hack away on the source code. If you spot a missing feature or a flaw in the program and you have the know-how to fix it, by all means do so.

GitHub makes it easy, albeit with a bit of knowledge with Git, to contribute code to a project. Here’s how:

  • Fork the project in question by clicking the fork button on the repository’s page.How to Use GitHub to Contribute to Open Source Projects
  • Hack away on the code and commit to your forked repository.
  • Send the project owner a pull request by clicking the pull request button on the repository’s page.How to Use GitHub to Contribute to Open Source Projects

And that is really all it takes. After the fact, wait for the project owner to respond to your pull request. You can follow its progress, add additional changes, and comment on your pull request by clicking the repository’s Pull Request tab.

Contribute Documentation

Every good piece of software will have good documentation. After all, software is nothing without its users, and users love things that are well-documented as it makes them easier to use. Depending on how documentation exists for a given project, you might find yourself making commits to text files in the repository itself. However, many projects have begun using GitHub’s wiki system to document their programs.

Don’t undervalue the importance of documentation. Like I said, users love documentation, so anything you can contribute is bound to be appreciated by someone in some shape or form. You could explain how a particular feature works, or document outstanding bugs and provide workarounds for users. You might also decide to write full-blown tutorials specific to a project, helping people get up on their feet and configuring or utilizing the project to best suit their needs.

Contribute Bug Reports and Feature Requests

Perhaps you have a great idea for a feature or you have spotted a bug in a program, but you really do not have the skills necessary to implement or fix it yourself. Do not fret, as you can still help out. Submit an issue to the project’s issue tracker by clicking on the aptly named Issues tab. Explain the problem you are encountering, or the idea you have to make the software better. After you have posted the issue, you will be able to discuss it with the developer to isolate the problem or better flesh out the meat of the feature at hand.

I love getting issue tickets on my projects. Whether they are bugs or features, I know that someone is interested enough to want my creation to expand and improve. Because I am simply one person, I can’t catch every glitch nor can I dream up every situation in which my work might be used. For that reason, I especially enjoy getting feature requests. For example, I develop Hubroid, a GitHub application for Android. When someone posts a feature request, I get to discover different work flows my application could be used for that I might not have even considered before. I enjoy making software better, and even more so when I am making it better for others.

Contribute Socially

So, maybe this project you enjoy is doing fine as far as documentation, bugs, and features go. What could you do to help out? Developers like it when people use their applications, so the best thing you can do is to get the word out that the application exists and show how it improves your life. Hop on your favorite social network and spread the word to your friends and followers. Hopefully you will be making their lives easier as well as giving satisfaction to the developer that their work is not going unnoticed.

I should also point out the fact that GitHub is a social network itself. If you “watch” a repository, you’re basically subscribing to updates from that repository — not only that, but you are also displaying your interest in the project publicly. Generally, the more watchers a repository has, the more popular it is, and henceforth the more support it has. Support the repositories you have an interest in by watching them; it doesn’t cost a thing.

Final Thoughts

While I wrote specifically about GitHub, there are tons of other open source project hosts out there. Each host offers its own specific services, but the ones I outlined above are typically standard across most of the major providers (source code repository, issue tracking, and a documentation system of some sort). In addition to GitHub, there is Google Code, Bitbucket, SourceForge, Gitorious, et al. Some services are tailored to specific types of projects. GitHub is obviously for projects using the Git version control system, but specific services such as RubyForge might target specific languages. There are tons to choose from, and tomorrow there will be even more, of course, as the open source ecosystem is gigantic — growing larger every day.

And I end now with some questions. What open source software do you enjoy the most? Have you contributed to it in any way, shape, or form? If you want to give back, you have the tools to do so at your disposal. I can guarantee quite a few others would appreciate your help. Hop to it.

Article Written by