How to start open-source contribution as a new developer
Tags: opensource, github, developer, beginners
Published: 2023-04-25 15:26:22

One of the ways to collaborate, sharpen your skills, and build your portfolio is through open-source contribution. This article will focus on open-source projects. Open-source projects are publicly available for anyone's use, modifications, and enhancements. These projects can be a code base or documentation. If you are starting your career and wondering how to use your new skills, this article is for you.

To completely benefit from this article, you must have a basic knowledge of git and GitHub.

In a few steps, I will take you through how you can start contributing to open-source projects today.


## Forking the repository

On identifying an open-source project on Github,  fork the repository (repo as often called) by clicking on `Fork`. You can only replicate a GitHub repository on your own repo using `Fork`.


![Repository Forking](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681371739012_image.png)


After clicking `Fork`, another page pops up. Click on `Create fork`. 


![Repository Forking](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681372126671_image.png)


You now have that same repo in your list of repositories on GitHub. This is what it looks like:


![Repository Forking](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681372342683_image.png)



## Cloning the repository

Until now, you only have the project on your remote repository. It’s time to have it on your local machine.

Click on `Code`, then click the double-square box beside the HTTPS URL to copy.


![Repository Cloning](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681372652899_image.png)


Navigate to any directory where you would like to have this project cloned on your computer, right-click on an empty space on the screen, and click on `Git Bash Here`.

A command window pops up; type `git clone`, then paste the HTTPS URL you copied earlier and click enter.

Note: You can’t use the keyboard shortcut Ctrl+V to paste the URL; you must right-click and select the paste option


![Repository Cloning](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681375302632_image.png)


You must wait for the cloning to complete. This may take up to several minutes, depending on the folder size.  A folder with the repo name will appear in your chosen directory during cloning. Allow the process to complete.


## Opening the file in VS code and making contributions

Open the file in VS code. It’s a good practice to always create your own branch while working on an open-source project. By creating your own branch, the project lead will be able to compare your contribution with the `main` or `master` branch. This practice allows for a cleaner and more reliable open-source collaboration.

Before working on the project, use the `git pull` command to update your local repository. This is to update the local repository in case other contributors have made some changes between the time you fork the repo and the time you want to contribute.

Create your branch, make contributions, and push to GitHub.

## Creating a Pull request(PR)

On pushing to GitHub, this is what you get:

![Pull request](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681377938042_image.png)


Click on compare & pull request from the previous.

Alternatively, click on `Pull requests`

![Pull request](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681376569571_image.png)


Click on `New pull request`

![Pull request](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681377287244_image.png)


In the new line box, type what you did (changes you made). You can also leave some comments. Click on  `Create pull request`

![Pull request](https://paper-attachments.dropboxusercontent.com/s_81B69DE75440EF30168B87F193CB92BDC2503EBC42915087196C5843A40A242E_1681380437170_image.png)

## Wrapping up

You just learned how to boost your confidence by collaborating and contributing to open-source projects. With your newly acquired skills, you can start contributing to open-source projects. Your contribution can be as little as editing a READ.md file. You can search Google for open-source projects and start contributing today.