First Open Source Contribution

- 3 mins

How to Make Your First Open Source Code Contribution

Markdowm Image To begin, you are going to be using First Contributions. This is a popular project that helps beginners make their first open-source contribution. You’ll also use GitHub’s Codespaces, your local development environment on the cloud, to enable a smooth contribution process.

To get started, you will need to create a GitHub account if you don’t already have one. Follow the signup process here. All done? Let’s get started.


How to Make Your First Open Source Contribution

There are six levels of headings. They correspond with the six levels of HTML headings. You’ve probably noticed them already in the page. Each level down uses one more hash character. But we are using just 4 of them.

Step One: Fork the Repository

To fork a repository means to make a copy of the repository in your GitHub account. This enables you to make changes without disrupting the main project.

Markdown Image

Markdown Image

Step Two: Clone the Repository

Codespaces automatically sets up a development environment for you with the repository already cloned. There’s no need to through the manual setup with your local terminal.

Markdown Image

Markdown Image

Step Three: Create a Branch

When using Codespaces there’s no need to change directories because the repository is already available in the current directory.

To create a new branch, you will need to type this command on your terminal:

git switch -c your-new-branch-name 

That is the git switch -c command along with what you want to name your branch.

Markdown Image

Step Four: Make Your Changes

The only change you’ll make for this tutorial is to add your name and a link to your GitHub account to the CONTRIBUTORS.MD file. This marks you as a contributor

Markdown Image

Step Five: Commit and Push

Now you’ll need to stage your changes by adding the changes that are ready to be committed. You can do this with the following command:

git add . or git add Contributors.md  

Markdown Image

Then commit your changes using the command below:

git commit -m "Add [your name] to the Contributor List"  

Markdown Image

Finally, push your changes to the repository like this:

git push -u origin your-branch-name 

Markdown Image

Once you see something similar to the screenshot below, you are on the right track.

Markdown Image

Step Six: Create a Pull Request

A pull request alerts the repository’s maintainers to the changes you’ve made. It allows them to review these changes before merging them into the main repository.

To create a PR, follow these steps:

Markdown Image

Markdown Image

Once you finish, the Frist contributions bot or the maintainers will merge your changes if they’re good to go

Conclusion

Congratulations! You have made your first contribution to open source. This is an exciting milestone that marks the beginning of your journey as a contributor.

But don’t stop there – there are hundreds of open-source projects on GitHub that need your help. Explore new projects and keep contributing.

Annie Pauline

Annie Pauline

A woman who travels the world eating noodles

comments powered by Disqus