Skip to content

Instantly share code, notes, and snippets.

@singhayushh
Last active January 27, 2021 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singhayushh/0f675fd1602a7ad426a7b19e63256168 to your computer and use it in GitHub Desktop.
Save singhayushh/0f675fd1602a7ad426a7b19e63256168 to your computer and use it in GitHub Desktop.
Getting started with open source contribution in GitHub

Hello, In this short guide, I will try to jot down everything that you need to know to start contributing to open source projects.

If you are looking for some other write-ups, click here and choose any.

What are open source projects?

Open source projects are those projects which are not only free to use, but are also free to read, edit or distribute (the code). To know if any project is open sourced or not, you need to go through the license the project has. You can know more about some standard open source licenses from here. In general, projects with the MIT license or the Unlicense have the least restrictions for you to edit, use or modify the project code.

How to get started with open source contribution?

Note that this guide is about contributing to projects hosted on github only.

  • First of all, you need to have a github account of course.

  • Browsing open source projects on basis of your interests and choice of programming language. While browsing through projects, you may find bugs or sections which need enhancements or new features entirely - these three are the most common domains in which open source contributions are made.

    The best way to filter out projects is to use the github search, github issues, github explore or being part of some open source community hubs!

  • Once you have found a project you want to contribute to:

    a. Fork the project - Learn how

    b. Clone the project - Learn how

    It is highly recommended that you use the git command line instead of the web platform

    c. After cloning the repository, the entire project code gets saved in your computer system locally. Usually, all open source repositories have directions to how to install additional softwares and running the project locally after cloning. The next step is to follow those instructions and set up the project.

    d. Before starting to code, there is one important step left, setting the upstream - Learn how

    Don't worry if these terms are totally new and confusing, you'll get to learn about them only after you use them regularly and do your own bit of research and reading!

    e. You can now start to code the application - the very reason you took to open source contribution!

Publishing your contribution

Once you have made all the changes in the code, it is now time to publish your changes. Now in this while, if the original project you had forked has had some changes (very likely if the project has a large number of contributors), you need to first make sure that your code is up to date. To achieve this, we use the command git pull upstream master

master or main is the name of the root branch of the project. If you are working in some other branch, you need to update the above command. Learn more about branches here

Having done the above, we are now ready to publish our changes:

  1. Using git add, git commit and git push - Learn how
  2. Creating a pull request - Learn how

Additional Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment