Skip to content

Commit 02f2007

Browse files
committed
docs: Add rule against force-pushing stack branches
Force-pushing a stack branch can cause GitHub to auto-merge or auto-close other PRs in the stack. Add explicit guidance to never use --force, --force-with-lease, or amend+push on stack branches.
1 parent 271fb8b commit 02f2007

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.cursor/rules/pr.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,5 @@ git push
258258
**Never merge into the collection branch.** Syncing only happens between stack PR branches. The collection branch is untouched until the user merges PRs through GitHub.
259259

260260
Prefer merge over rebase — it preserves commit history, doesn't invalidate existing review comments, and avoids the need for force-pushing. Only rebase if explicitly requested.
261+
262+
**Never force-push stack branches.** Do not use `--force`, `--force-with-lease`, or `git push` after `git commit --amend` on branches that are part of a stack. Force-pushing a stack branch can cause GitHub to auto-merge or auto-close other PRs in the stack. If a commit needs fixing, add a new commit instead of amending.

0 commit comments

Comments
 (0)