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.
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.
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!
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:
- Getting started with GitHub - click here
- All about GitHub "issues" - click here
- GitHub Guides - click here