Maintaining a Fork with Upstream Updates
This workflow lets you make personal changes to a forked repo while still pulling in updates from the original developer.
Initial Setup
1. Fork the repo on GitHub using the "Fork" button on the project page.
2. Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/tasks.git
cd tasks
3. Add the original repo as an upstream remote:
git remote add upstream https://github.com/ORIGINAL_AUTHOR/tasks.git
Verify your remotes:
git remote -v
# origin https://github.com/YOUR_USERNAME/tasks.git (fetch/push)
# upstream https://github.com/ORIGINAL_AUTHOR/tasks.git (fetch/push)
Making Your Own Changes
Work on your fork as normal — commit and push to origin:
git add .
git commit -m "my change"
git push origin main
Pulling in Upstream Updates
When the original developer releases updates you want to incorporate:
git fetch upstream
git merge upstream/main
git push origin main
If both you and upstream modified the same files, Git will flag conflicts. Open the affected files, resolve the conflicts manually, then:
git add .
git commit -m "merge upstream changes"
git push origin main
Alternative: Rebase (cleaner history)
git fetch upstream
git rebase upstream/main
git push origin main --force-with-lease
Rebase rewrites your commits on top of the latest upstream, resulting in a linear history with no merge commits.
Tips
- Keep your customizations isolated to specific files when possible — this reduces merge conflicts.
- Run
git fetch upstreamperiodically to check for upstream changes before they pile up. - You can sync this way indefinitely — there is no expiration on tracking an upstream remote.