DEV Community

Cover image for GitHub Workflow And Contribute To Open Source
Slim Coder
Slim Coder

Posted on

2 1

GitHub Workflow And Contribute To Open Source

In this article, we will discuss GitHub Workflow and how to contribute to open-source projects on GitHub.

Table Of Contents

Fork A Repository

First of all, we need to fork a repository. A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
Suppose if you want to contribute in freeocdecamp then you need to fork freecodecamp repository to contribute.
You can see a fork button on the top right corner.

Clone Forked

Now clone the forked repository by clicking clone or download button and open it in your favorite IDE to make changes.

Create A New Branch

Now our forked repository is cloned and we have opened it in our favorite IDE now we need to create a local branch with this command.

  git checkout -b branch_name //This will create a new branch locally
Enter fullscreen mode Exit fullscreen mode

Add Commits

Now we need to make changes and add commits locally.
The command is given below.

  git add . //This will add local changes
  git commit -m "commit_name" //This will add local changes and add the commit
Enter fullscreen mode Exit fullscreen mode

This command will add local commits.

Push To Forked Repository

Now we need to push our local branch and commit to the remote (forked) repository.
The command is given below.

  git push //This will push changes to remote branch
Enter fullscreen mode Exit fullscreen mode




Create A Pull Request

Now we have pushed local changes to the remote forked repository. Now we need to create a pull request which will be sent to the remote original repository.
After pushing the code we need create a new pull request by click on create pull request button and create a PR and select your branch to which you have made changes.

Code Review

Our PR is created successfully now we need to wait for our code to be review by the repository contributor/owner.

PR Merged

Our code is reviewed successfully by contributor/owner and now your PR is in a ready state to merge with the original repository.
The original repository owner will merge your PR. Hurray!
Congratulations you have successfully contributed to open source.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️