git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git pull upstream master
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git pull upstream master
Just FYI, here's a method for anyone who wants to sync their GitHub forks with upstream without having to create a local clone:
The official GitHub CLI now supports syncing forks remotely with this simple command... (From GitHub's official docs:) "To update the remote fork from its parent, use the
gh repo sync -b BRANCH-NAME
subcommand and supply your fork and branch name as arguments.If the changes from the upstream repository cause conflict then the GitHub CLI can't sync. You can set the
--force
flag to overwrite the destination branch."GitHub CLI will attempt to match your default/main/master branch with that of the parent and sync the two -- assuming there are no merge conflicts. Otherwise, it will notify of such.