- Check your fork knows the original
git remote -vLook for a line starting with upstream. If it's missing, run the next step. If it's there, skip it.
- Add the original as upstream
git remote add upstream https://github.com/octocat/hello-world.git - Download the original's latest changes
git fetch upstream - Switch to your main branch
git switch main - Bring those changes into your branch
git merge upstream/mainIf you haven't changed main yourself, this just moves it forward with no merge commit.
- Send the updated branch to your fork on GitHub
git push origin main - Or do it all in one go with GitHub CLI
gh repo sync your-name/hello-worldOptional. Updates the fork on GitHub only. Run git pull afterwards to update your computer too.
Check it worked
- Check your branch matches the original
git log --oneline -3 upstream/main main
Undo it
- Undo the merge before you push
git reset --hard ORIG_HEADPuts your branch back where it was. Careful: it also throws away changes you haven't committed.
- Check your fork knows the original
git remote -vLook for a line starting with upstream. If it's missing, run the next step. If it's there, skip it.
- Add the original as upstream
git remote add upstream https://github.com/octocat/hello-world.git - Download the original's latest changes
git fetch upstream - Switch to your main branch
git switch main - Bring those changes into your branch
git merge upstream/mainIf you haven't changed main yourself, this just moves it forward with no merge commit.
- Send the updated branch to your fork on GitHub
git push origin main - Or do it all in one go with GitHub CLI
gh repo sync your-name/hello-worldOptional. Updates the fork on GitHub only. Run git pull afterwards to update your computer too.
Check it worked
- Check your branch matches the original
git log --oneline -3 upstream/main main
Undo it
- Undo the merge before you push
git reset --hard ORIG_HEADPuts your branch back where it was. Careful: it also throws away changes you haven't committed.
- Check your fork knows the original
git remote -vLook for a line starting with upstream. If it's missing, run the next step. If it's there, skip it.
- Add the original as upstream
git remote add upstream https://github.com/octocat/hello-world.git - Download the original's latest changes
git fetch upstream - Switch to your main branch
git switch main - Bring those changes into your branch
git merge upstream/mainIf you haven't changed main yourself, this just moves it forward with no merge commit.
- Send the updated branch to your fork on GitHub
git push origin main - Or do it all in one go with GitHub CLI
gh repo sync your-name/hello-worldOptional. Updates the fork on GitHub only. Run git pull afterwards to update your computer too.
Check it worked
- Check your branch matches the original
git log --oneline -3 upstream/main main
Undo it
- Undo the merge before you push
git reset --hard ORIG_HEADPuts your branch back where it was. Careful: it also throws away changes you haven't committed.

New to Fork? I explain it in plain English on Layman Terms.