DEV Community

Cover image for Syncing Github Forks in 2 steps
Farhan Yahya
Farhan Yahya

Posted on • Edited on

4 1

Syncing Github Forks in 2 steps

Most of the time, after forking and working on a project other pull requests are being merged which leaves your copy behind the current state of the project.
This post walks you through a simple guide on how to sync your fork.

1. Add remote from the original project repo

This is the remote URL to the original project which you want to update your fork from.

git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git

Now check if upstream has been added

git remote -v

This will list the remote url's active in the local repo

2. Updating fork from the original repo

Run the below command to make a pull.

git pull upstream master

This pulls changes from the original repo and merges it into your local copy. And after this is happy coding :)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

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

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay