How to Contribute to Open Source Projects for the First Time using GitHub

How to Contribute to Open Source Projects for the First Time using GitHub

ยท

3 min read

Contributing to Open Source opens up lots of opportunities for the Developers as it acts as a proof of work when applying for jobs and there are high chances that Companies themselves would reach out to you for a Job Role via GitHub if your profile happens to be Good Enough.

Assuming you have installed Git Bash and have a GitHub Account lets Start !

1. Forking the Project on GitHub

Go the Repository you wish to contribute and fork it

Fork.png

createfork.png

Copy the Repository Link under the Code Button

2point.png

3.Git Bash In your Desktop or Desired Folder

Right Click on your mouse and click Git Bash here.

gitbashhere.png

4.Clone the Project

Clone the project using your Repository link (from 2 Step) command below:

git clone [url]

Use (Windows+ V) to paste the link - Windows

Use (Command + V) to paste the link - Mac

You should be able to see your project cloned in your bashed folder (in our case on Desktop)

cloned.png

5.Change the Directory to the Cloned Folder and Start Contributing

cd [repository-name]

reponame.png

Example:

egcontribution.png We added Code13.txt file as a Contribution to the project

  • Go the Original Repository from where you have forked ( known as Upstream ) and copy it's link. You'll be able to locate it from your repository itself.

upstreamfolder.png

upstreamrepolink.png remoteadd.png

git remote add upstream [link]

7. Create a New Branch for the Project Contribution and Checkout to it.

  • It's always a Good Practice to create a new branch for every commit that we make.

  • We'll commit the changes on that branch.

  • Branch Name should depict what change have you done (again a good practice)

branches.png

branchname.png

git branch [branch-name]

8. Checkout to the created Branch and Stage the Changes

Checkout to the newly created branch and stage it using add command.

Checkout: moving the head to that branch

checkout.png

git checkout [branch-name]

Stage: Start tracking those files in order to Commit

staging.png

git add .

9. Commit the Changes

Commit: Submitting the Changes

commit.png

git commit -m "Message to be Typed"

10. Push the Changes

  • Push : Submitting the Changes which reflects on Online GitHub Repository

Push the changes with the Branch Name

pushing.png

git push origin [branch-name]

Go to your GitHub Profile and Refresh you'll be able to see your changes under your created branch

done.png

  • Open the Compare and Pull Request Section as seen in the image above and Create the Pull Request and you're done with your Very First Pull Request !
  • Sit back and relax you're done!

If you liked this Blog do let us know in the Comments.

Take Care !

โœŒ๐Ÿ˜‰

ย