feat(setup-remotes): pin branch.main.pushRemote to origin

Direct pushes on the canonical branch now target upstream instead of
the personal fork whose branch-protection rules can diverge. Feature
branches still fall back to the fork via remote.pushDefault.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 23:36:10 +02:00
parent 921d84aa67
commit e9653cff2e
6 changed files with 65 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ Configures a clone for a fork-based workflow and is idempotent.
- `fork` points at the maintainer's personal fork.
- `main` tracks `origin/main`.
- `remote.pushDefault` = `fork`, `push.default` = `current` so every `git push` and every `git push -u` for a new branch lands on the fork, not on the canonical repo.
- `branch.main.pushRemote` = `origin` so a direct push on the canonical branch targets upstream, not the personal fork (whose branch-protection rules can diverge).
Usage: