git rebase with upstream fork

0 minute read

This post details the instructions to sync forked repo with upstream.

Steps to rebase

Add original repo to fork as upstream

git remote add upstream https://link/to/original/repo.git

Fetch master (or main) from upstream

git fetch upstream master

Rebase current branch with upstream master

git rebase upstream/master

Force push to remote

git push --force