/ Home

Git Fork and Bring Original Changes

How to Update Your Fork with the Original Repo’s Latest Changes

1. Add the original repository as upstream

Run this once inside your local clone:

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPO.git

Verify:

git remote -v

Expected:


2. Fetch latest updates from the upstream repo

git fetch upstream

3. Merge (or rebase) upstream changes into your local main

git checkout main
git merge upstream/main

Alternative (linear history):

git rebase upstream/main

4. Push updated main branch to your fork

git push origin main

Short Version

git fetch upstream
git checkout main
git merge upstream/main
git push origin main