First Open-Source Contribution
Tags: opensource, beginners, learning, git
Published: 2024-01-29 12:35:28

As developers, we seek the best resources to enhance our skills such as: watching video courses, reading documentation, etc. However, we may not feel adequately prepared to apply for a developer job. Open-source contributions can provide the hands-on experience required for most job vacancies. 

In this post I will show you how to make your first-ever open-source contribution. This way, you can gain the confidence that you can achieve it and even more.


## WHY TO DO IT?
Have you ever come across a job vacancy that requires "experience"? In open-source projects, you can contribute to large, professional projects used by millions of users, adding your knowledge and value to the product. This allows you to gain experience across various types of projects, such as e-commerce, health apps, Fintech, etc.


## BENEFITS OF CONTRIBUTING TO OPEN-SOURCE PROJECTS
✔ You can practice your programming language and your Git skill as well.
✔ Read and understand professional code and its structure/architecture.
✔ Practicing your soft skills.
✔ Work as a part of a team.
✔ Get your code reviewed by seasoned engineers.


## HOW TO DO IT?
Let's dive straight into contributing to an open-source project for the first time.

We will contribute to the repository of "First contributions". You can go to the following link: https://github.com/firstcontributions/first-contributions

Once there in the page of the previous link, we will clone the repository:

I) First step: We will fork the repository to create a copy of this repository into our account.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9nxfbgdl3iexgowwfmb.png)

II) Second step: We will go to our account and look for the forked repository of "first-contributions" and we will copy the "web url link" to clone it in the next step.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jzj5g5djazr0wut04fm.png)

III) Third step: We will clone it into our local machine / computer using the following git command:
**git clone "replace this with the web url link copied in the previous step"**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2sir9agu42cq742pvrd.png)

I recommend to clone it on your desktop, so you have the folder of "first-contribution" there and you can drag and drop it into your favorite code editor, I will use VS Code. Please, check that you are in the right route(A) and in the "cmd" console("B" If you're using Windows)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fryjiufzf5kp6wz608lz.png)

IV) Fourth step: We will create a new branch and switch into it, we can do each one by separate actions, but this time we will use the command 'git switch', which creates a new branch and switch into it thanks to the expression '-c', in the previous image there is my example using the name of the new branch I wanted to give.

Git command: **git switch -c your-new-branch-name**

*Replace 'your-new-brach-name' for the name you want to give to your branch. I want to give the name 'happy-coding' to my new branch, so I will execute:
**git switch -c happy-coding**

V) FIfth step: We will finally do our contribution, go to the file Contributors.md , add your github name and the link to it, follow the structure of the previous contributions made by other people.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcy8ig3cx2dupqxtm19i.png)

VI) Sixth step: Once you added you're done with fifth step, we will commit and push our changes. Execute the following git commands, review that you are in the right path.

**git add Contributors.md**
**git commit -m "Add your-name to Contributors list"**
* Replace "Add your-name to Contributors list for some commit message, an example: git commit -m "My new contribution JJOA"
**git push -u origin your-branch-name**

VII) Seventh step: We are almost done, now we need to go to our github account, then to our forked repository of "first-contributors", now click on the "Compare & pull request" and add your message on the Readme and it is done, you have did your first open-source contribution!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6y7voyco9147av2964js.png)

Wonder you enjoyed it and gave you the motivation to dive deep into open-source contributions, I will keep posting posts related to open-source, if you have any question just direct message me I will be glad to help you.

Here is the link for the video I created explaining all the previous process: https://youtu.be/gHGLlr9L9X8