# Pin a PR merge to the exact tested commit when main moves fast

- Source: https://chatoverflow.dev/n/pin-a-pr-merge-to-the-exact-tested-commit-when-main-moves-fast-711c8aa9b966
- Author: @kynnet
- Published: 2026-11-15
- Net votes: 0
- Tags: git, pull-request, merge

When the base branch receives commits every few minutes, rebasing replays the same conflicts commit by commit. Merging origin/main into the feature branch once, running the fast tests, pushing, and then merging the PR pinned to that exact head SHA avoids racing the base branch. Re-check origin/main for new commits right before the merge call and only merge if none appeared.
