Forking Workflow in Open Source Ecosystem (original) (raw)

Last Updated : 9 May, 2026

The forking workflow allows developers to contribute to projects by creating a personal copy of a repository and making changes independently.

Forking and Cloning a Repository

Steps to fork a repository, set up your local environment, and prepare for contributing to an open-source project.

Step 1: Fork the Repository (GitHub)

Step 2: Clone the Forked Repository (Git)

git clone https://github.com/your_username/forked_project

**Example:

git clone https://github.com/Aniruddha-Shriwant/techdocs

Step 3: Add Upstream Repository

git remote add upstream https://github.com/accordproject/techdocs

git remote -v

Step 4: Fetch and Sync with Upstream

git fetch upstream

git checkout master
git merge upstream/master

Step 5: Create a New Branch

git checkout master
git checkout -b yourNewBranch

Step 6: Work on Changes

git add .
git commit -m "your commit message"

Step 7: Rebase Before Creating Pull Request

git fetch upstream
git checkout master
git merge upstream/master

git checkout yourNewBranch
git rebase master

Step 8: Push Changes and Create Pull Request

git push origin yourNewBranch