If you’re looking at developing software, going the open source route is one of the best ways to do it. Not only can people view your open source code and submit their own fixes, but you are also encouraged to look at other people’s code to use as a framework or inspiration.

While going open source might be a good choice, you’ll also need to invest in the right community. GitHub is one of the best places to do this, not only because of the sheer amount of users who visit the site, but also because of the features that GitHub offers. If you find an open source app on GitHub, I’ll show you a few things you can do with it, including viewing, editing, and forking the code.

Create an Account

Before you get started with using GitHub, it’s best to create an account with them. Creating an account is free and will allow you to take advantage of numerous features such as forking. GitHub also has different membership levels besides the free one, but a free account should be more than enough for personal use.

Checking Out a Project

Once you have an account you can dive straight into an open source application found on GitHub. Here you can see the application’s project page, including folders and files pertaining to the application, a network graph, a list of pull requests, open issues, a wiki, and other graphs. Obviously, if you want to see the code within the files, you should click on them and you’ll be presented with the full source code. As far as interpreting the code goes, you’ll need to have some background in the programming language that the application is written in, whether it be Java, C++, Python, or something else. For those wondering, the screenshot shows Caleb Evan’s jcanvasQuickly & Easily Manipulate HTML5's Canvas Element With jCanvasQuickly & Easily Manipulate HTML5's Canvas Element With jCanvasThe web as we know it is evolving faster than ever before. As of late, HTML5 is coming into the scene, providing the capability of developing highly interactive web apps without the need for the...Read More project.

Forking a Project

Editing the code requires some additional steps. If you wish to copy the code without officially forking it on GitHub, you’ll need to download the project’s files and then edit them locally on your computer. However, if you’re truly looking at using the currently available source and creating your own project with it and going in your own direction, you’ll want to fork it. Forking can be accomplished with an account, and by clicking on “Fork” on the project’s page as shown in the screenshot. The next few instructions are for Linux users who should install the Git package for their respective distribution.

If you wish to retrieve the repository’s files to your computer, you’ll need to run the command git clone https://github.com/username/project_name.git, replacing username with your GitHub username and project_name with the name of the application project that you just forked. Run this command within a folder that should contain all of your GitHub projects, as each git clone command will create a new folder within the one you’re currently residing. This is another way of downloading a project’s file as it doesn’t require login credentials. Now you can change the files as you please using any text editor or IDE. For Linux users, I’d recommend Eclipse or Geany as they’re great programming editors — Eclipse being more full-featured and Geany being leaner. Windows users can also use the native GitHub client.

Uploading Changes to Your Project

Once you’re done making changes, you can upload the updated files back to GitHub using the command git push origin master while inside the application’s folder. This pushes the changes back into the “origin” pointer (your forked project) and the master branch (default location of source code).

Keeping Track of Upstream

If you’d like to keep track of the upstream project (the one that you forked to create your own), then you’ll need to add what’s called an additional remote. This is basically just another keyword you can use while you’re inside your application’s folder. To create the new remote, run the command git remote add upstream https://github.com/username/project_name.git, where username should be replaced by the username of the original project, and project_name should be replaced by its project name.

Merging Upstream Changes

If you notice that the upstream project has been updated and you’d like to incorporate the changes, you can run git pull upstream after creating the additional remote, and GitHub will download and merge changes from upstream into your project’s files. If everything works perfectly after running that command, you can immediately run git push origin master to push the updates to your own project.

Pull Requests

If you’d like to contribute back to the upstream project, it’s best to push any changes to your own fork of the project (or your own branch of the upstream project, but that’s only after the original author makes special arrangements). Once you’ve pushed those changes to your repository, you can go to GitHub and submit a pull request. This notifies the original author of the upstream project that you’d like him/her to review the changes that you’ve made and have them pull your changes into the upstream project. It’s a common courtesy to at least offer some of your own modifications back to the upstream project for them to pull as a thank you for forking their project. Whether they accept your request is up to them.

Great Article!!Added it in my favorite articles list..This is my luck to read this article while I've just signed up GitHub and don't know where to start...
There is quick guide on that site for beginner,but long and little bore to read.your guide is clear and informative..Thanks..:)

I've tried looking at the code for some projects, but I never know where to start. Once I get to the list of files, how do I know which one is the start of the program (especially if there's no "main.cpp" or similar file)?