GitHub Contribution: Your First PR

GitHub Contribution: Your First PR

Learn about Contribution in OpenSource.


7 min read

Hey Guys! This is Shivam.

Today, we are going to discuss Open Source. We will learn:

  • What is an Open Source?
  • Basic Git Commands you need to start.
  • How we can contribute to an Open-Source?
  • Example to Contribute to an Open-Source.
  • Which community you should join to get Opportunities?

Let's start with a definition of an Open-Source.

What is an Open-Source or GitHub?

In simple terms, GitHub is a code hosting platform where you can upload your codes like you upload videos or photos on Social Media apps. If you and your friend want to work on the same project but you are in different places then at that time Github comes into the picture and, we can share our code.

Now, one thing you always keep in mind before getting started with an Open-Source or GitHub is that "GitHub is for Collaborating not for a Competition". So, if you want to collaborate with people, learn in public, help others by contributing, and want to grab opportunities then, you can join GitHub and start your journey.

Basic Git Commands

Now to start contributing to a project we need to learn about "Git Commands". Now here I am not going to deep dive into Git Commands because today we are focusing on the contribution part. But I will tell you some of the basic commands from which you can start.

Now, let's see the basic commands of Git to contribute to an Open Source.

  • Git Status: The git status command displays the state of the working directory and the staging area
git status
  • Git Commit: The git commit command captures a snapshot of the project's currently staged changes.
git commit -m "Write about what you change in the project"
  • Git Push: The git push command is used to upload local repository content to a remote repository.
git push
  • Git Clone: git clone is a Git command line utility that is used to target an existing repository and create a clone or copy of the target repository
git clone "ssh key"

-- will talk about the ssh key during the example

Here are some of the basic commands you should know about during your contribution. But apart from these, there are more git commands. You can check here

Now let's start with an example to understand contribution in GitHub.

How we can contribute to an Open-Source?

To contribute to a Project you should have a GitHub account. If you have not yet, you can create it here.

Now, after creating an account you can find projects based on your skills for contribution. For this Tutorial, I choose the project named HactoberFest. I recommend everyone new to GitHub contribute to this Repository.

Now, for this contribution I am going to use "VS Code" you can choose any code editor.

  • Let's start with a contribution. Click here and you will land on this pageπŸ‘‡

2022-05-26 (31).png

  • Now click on the Fork(Fork is like a copy of that project) button to Fork this Repository.πŸ‘‡

2022-05-26 (2)_LI.jpg

  • Now this window will appear, Click on "Create Fork" to fork the Repository.

2022-05-26 (32).png

Now you will see that the same Hacktoberfest repository is appearing in your account now(You can see your name in the left corner). And below your name, it is written that Forked from EddiehubCommunity, which means that we made a copy of EddieHubCommunity's project. Now you can edit this project.

2022-05-26 (33).png

  • Now click on the code button which appears in green color.

2022-05-26 (2).png

  • And the drop-down will appear. Click on the "SSH" and copy this "SSH key". ssh key helps you to link your remote repository with your local repository. Now if you don't have an ssh key you can make a new one by following this article or for now you can start by clicking GitHub CLI or HTTPS. Click on any one of three and copy that key.

2022-05-26 (3)_LI.jpg

  • Now after copying, go to your code editor and a new fresh folder and open up the terminal in it. Now we are going to clone that repository by running the below commandπŸ‘‡
    git clone
    The above command looks like this πŸ‘‡ in the terminal.

2022-05-26 (5).png

Now, we are switching to this repository's folder for that we run the cd command.

cd folder name

You can do like this πŸ‘‡ here our folder name is hacktoberfest-practice

2022-05-26 (8)_LI.jpg

  • Now we are in this folder, now we can start contributing. Before contributing to any project you should read that project's Readme file.

  • Now for this contribution we go to the readme file. You can see that readme file which appears on the left side.

Note- Every Project has different-different contribution guidelines. So, be sure you check out that project's readme file before starting to contribute to it.

Now click on the readme file.

2022-05-26 (10).png

  • Now, after clicking on the readme file you will see this screen πŸ‘‡. Now if you scroll down a little bit you will see, that there are many names present in it. These are the names that are added by many different contributors. Now, we will be adding our name to it and being the contributor

2022-05-26 (12).png

  • So, now scroll down the screen as per your name's first letter. My name starts with the letter S so, I will scroll till S and write my name.

Write this command where you want to add your name.

[Full Name](

-- don't do any typo mistakes.

2022-05-26 (13).png

  • Now, after writing your name check the status of the file, by typing this πŸ‘‡ command in the terminal.
git status
  • Here you will see the file name which you just changed in red color.πŸ‘‡

2022-05-26 (14).png

Here it is not staged yet so, we will now stage this file by writing the commandπŸ‘‡ in the terminal.

git add filename
git add.
  • Now after staging it again run the status command. Now, at this time you'll see that it is showing with green color.

2022-05-26 (16).png

  • Now we will commit this file. In simple terms, commit means, leaving a note to that file, which helps, later on, to understand what change you do on that file. So, for commit, run this command. πŸ‘‡
git commit -m "Any message you want to add"

This will look like thisπŸ‘‡

2022-05-26 (17).png

And, when you press enter you will see something like thisπŸ‘‡. Here it will show you how many lines you changed or deleted.

2022-05-26 (18).png

  • Now we will push our local code to the remote repository, to do that we will run this πŸ‘‡
git push

It will look like this πŸ‘‡

2022-05-26 (20).png

Now go to your GitHub account and click on the Hacktoberfest repository. There you'll see the all files. Now click on the Pull Request where you'll see this πŸ‘‡ screen.

2022-05-26 (22)_LI.jpg

  • Click on the New Pull Request option and, you'll see this screen πŸ‘‡

2022-05-26 (23).png

  • Now click on the "Create Pull Request" option. Now, this πŸ‘‡ screen will appear. Write your name in the text box as you can see in the image below I write mine(Don't do any other changes).

2022-05-26 (24).png

  • Click on the "Create Pull Request" button and you will see this πŸ‘‡screen with your account name.

2022-05-26 (25).png

Here you created your "Pull Request(PR)". After some time there will be a message which gonna be look like thisπŸ‘‡. It means your first Open-Source Contribution is done.

2022-05-26 (26).png

If all checks don't pass it means, you have done something wrong and you have to do some checks where you edit the code.


So, this is the contribution process of GitHub. You should have to contribute daily, Just give 1 hour a day to open source, and then, the response will be going to surprise you.

Things to Remember

  • Don't hesitate to ask questions
  • Don't think you don't have skills. A person with 0 skills can also contribute
  • Join Good-Good communities for more improvement.

Community You Can Join

There are many good communities on GitHub you can join any of them it's up to you. Here are the 2 communities which will help you to understand more about OpenSource.

Thank You

Hope you'll learn something from this blog. If you found something good don't forget to give your feedback.

You can join me here πŸ‘‡ for more daily updates.

Twitter GitHub ShowwCase

Did you find this article valuable?

Support Shivam Katare by becoming a sponsor. Any amount is appreciated!