DEV Community

Wincent Balin
Wincent Balin

Posted on • Originally published at ofdigitalwater.postach.io on

3 1

How to keep your forked GitHub repository up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

Enter fullscreen mode Exit fullscreen mode

2. Add remote from original repository to your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

Enter fullscreen mode Exit fullscreen mode

3. Updating your fork from original repo to keep up with their changes:

git pull upstream master

Enter fullscreen mode Exit fullscreen mode

Source: this gist

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more