Sync fork to upstream, discard local commits

Check for upstream.

git remote -v

If necessary, add an upstream.

git remote add upstream git@git.example.com:some-gatekeeper-maintainer/some-project.git

Confirm upstream.

git remote -v

Confirm you're on main, reset.

git checkout main
git fetch upstream
git reset --hard upstream/master
git push --force

Pages that link to this page