- Add the remote (original repo that you forked) and call it
upstream
git remote add upstream https://github.com/original-repo/name.git- Fetch all branches of remote upstream
git fetch upstream- Rewrite your
mainbranch with upstream’smainusinggit rebase.
git rebase upstream/main- Push your updates to
main. You may need to force the push with--force.
git push origin main --force