docs: Prevent downstream commits from landing on template#76
Merged
Conversation
Add explicit guidance and a hard guardrail so AI agents and humans working in a downstream repo cannot accidentally push to the template: - Disable the push URL on the `upstream` remote by default (`git remote set-url --push upstream DISABLED`) - State plainly that `upstream` is fetch-only This closes the gap that lets `git push upstream …` silently publish a downstream project's commits onto `peerigon/template`'s main branch.
Member
|
Merged without testing 😱 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
upstreamremote's push URL (git remote set-url --push upstream DISABLED).upstreamis fetch-only.Why
Downstream projects add this repo as their
upstreamremote. By default,git remote add upstream …configures both fetch and push URLs. That lets a straygit push upstream main(from a human, or an AI agent runninggit pushwithout thinking) publish a downstream project's commits ontopeerigon/template's main branch.This actually happened — it was recoverable via admin force-push, but a lightweight guardrail prevents recurrence at the source.
With the push URL set to
DISABLED, any accidental push fails immediately:…instead of silently succeeding against a public template repo.
Test plan
git remote set-url --push upstream DISABLEDcommand and confirmgit push upstreamnow fails fast whilegit fetch upstreamstill workspeerigon/template'smainto require PRs, so direct pushes are rejected server-side as well🤖 Generated with Claude Code