Overcoming the anxiety of creating your first open-source contribution 🦄
Tags: opensource, git, github
Published: 2020-03-21 09:23:06

*Note: This article is for the people who already know how to create Pull Requests but are too scared to create one or don't know how to exactly find an issue or a repository to work on. If you need help with the process of creating PR, you can check out [Git and GitHub Guide on Atlassian](https://www.atlassian.com/git) or [Harsh's Git Basic Guide](https://github.com/HarshKapadia2/git_basics)*


Open-source can be overwhelming and contributing to someone else's project can seem difficult at first. 

"What if I mess everything up?", "What if I do something dumb with the code?", "I am ready... but these codebases are so huge... how do I find and fix bugs in this", "I can't understand the codebase... it's so huge".

... these are some of the questions I had after learning git and GitHub. Even though I knew how to create a Pull Request, it was either too scary to actually send a Pull Request to someone or I simply didn't understand their codebase.

This article will hopefully help you through this phase and will help you create your first Pull Request.

Let's see how you can find the right repository and an issue.

# Exploring and finding the right repository and issue
For the initial pull request, the first-contributions repository is quite cool to get started. You have to add your name to `CONTRIBUTORS.md` and send a Pull Request.
{% github https://github.com/firstcontributions/first-contributions %}

This is super helpful as an initial practice.

or you can contribute to any of your friend's repository.

Even after contributing to the first-contributions repository, sending a pull request to an actual project and finding an issue in the repository can still seem a difficult thing to do.

You can start by
- [Contributing to something you use](#contributing-to-something-you-use)
*or*
- [Contributing to something that looks cool](#contributing-to-something-that-looks-cool)

## - Contributing to something you use.
One option you have is to contribute to a project that you currently use. You can make a list of the projects that you are using. NPM packages or Python packages, VSCode Extensions, Frameworks, Libraries, list everything you use! 

While using these projects you might have discovered this one particular feature that you feel is missing or documentation for particular function needs to be better or maybe a bug that you found while using it or even a spelling mistake!

Search for the GitHub repository of that project and create an issue mentioning the changes you want to make. If your change is fixing a typo or obvious bug that does not require you to waste too much of your time and effort, then you can create a pull request directly. For feature requests, always create an issue before you start working on it.

### Example?
Recently I was reading DEV.to's editor guide and found that there's an extra `%` in the guide so I quickly made a PR that removed the extra `%`. 

Here's my PR
{% github pr https://github.com/thepracticaldev/dev.to/pull/4500 %}

P.S. I am super proud of this Pull Request 🐨🎉



## - Contributing to something that looks cool.

Contributing to something you use is not always an option. It can be difficult to find issues after one point so you can simply go to repositories that you find interesting and check out issues in that repository.

Some repositories have issues with labels like "Good First Issue", "Difficulty: Easy" or something equivalent. You can find these issues and comment with something like "Hey this seems cool! can I work on this?". If you need any help or extra information you can comment on this issue and ask for help.

Also, it's not necessary to only go through "Good First Issues" sometimes other issues can seem easier to you. So do go through other issues as well and choose the one that looks interesting!

### Example?
During [Hacktoberfest](http://hacktoberfest.digitalocean.com/) I was randomly searching for issues to work on and came across this issue on DEV.to about bad coloring in the profile theme. Do check out the conversation here:
{% github issue https://github.com/thepracticaldev/dev.to/issues/4106 %}


Awesome🎉 Now you have an issue to work on! Let's code!!

# Writing code and sending a Pull Request

Here's a thing about large codebases, NOBODY KNOWS HOW THE WHOLE CODEBASE WORKS NOT EVEN THE MAINTAINER! so you don't really have to go through every single file trying to understand how every single function works.

You only have to search for the file where you want to make changes.

## - Searching for the right file
I usually search using the text that is visible on the screen so If I want to make a change in DEV's navigation bar, I would search for "WRITE A POST" (visible in the desktop navigation bar)

Here are the search results:
![Screenshot of search results after searching write a post which display result from a file named _nav_menu_html.erb at the top](https://dev-to-uploads.s3.amazonaws.com/i/any3cffm4vwochqyscmf.png)


## - Local setup
Repositories have a local setup guide in README or CONTRIBUTINGmd. Usually, this includes cloning a repository and installing the required dependencies.

## - Writing the code
Do go through the contribution guidelines of the repository to see if there are any instructions about writing the code. Even if you miss something that is fine maintainer will let you know after you make the PR. Going through contribution guidelines will just save your time of making changes later.

## - Sending Pull Request
HIT THAT "CREATE PULL REQUEST" BUTTON!!! 
and it's totally ok if you miss something or change the wrong function or a wrong file (trust me I've done that a lot). Maintainers will later request you changes if required. You can always commit to the branch and changes will reflect in the PR.


Finally, even small contributions play a major role in an open-source project so don't feel awkward while sending PR for fixing a typo. It is a fair contribution and as a maintainer, these contributions are super useful for me.


**EVERY. CONTRIBUTION. IS. IMPORATNT.**

---


Thank you for reading the article. If you have any questions or any help regarding open-source and GitHub, you can drop them in the comments or DM me on my [Twitter @saurabhcodes](https://twitter.com/saurabhcodes). 

You can also follow me on [GitHub @saurabhdaware](https://github.com/saurabhdaware)


Stay Home, Stay Safe. 🌻