Skip to content

docs: Prevent downstream commits from landing on template#76

Merged
jhnns merged 1 commit intomainfrom
docs/upstream-remote-safety
Apr 15, 2026
Merged

docs: Prevent downstream commits from landing on template#76
jhnns merged 1 commit intomainfrom
docs/upstream-remote-safety

Conversation

@meaku
Copy link
Copy Markdown
Member

@meaku meaku commented Apr 15, 2026

Summary

  • Add a Step 0 to the "Pulling Updates from Upstream" section that disables the upstream remote's push URL (git remote set-url --push upstream DISABLED).
  • State explicitly that upstream is fetch-only.

Why

Downstream projects add this repo as their upstream remote. By default, git remote add upstream … configures both fetch and push URLs. That lets a stray git push upstream main (from a human, or an AI agent running git push without thinking) publish a downstream project's commits onto peerigon/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:

fatal: 'DISABLED' does not appear to be a git repository

…instead of silently succeeding against a public template repo.

Test plan

  • Read through the new Step 0 — wording is clear and the commands are correct
  • In a test repo, run the git remote set-url --push upstream DISABLED command and confirm git push upstream now fails fast while git fetch upstream still works
  • (Optional, separate follow-up) Enable branch protection on peerigon/template's main to require PRs, so direct pushes are rejected server-side as well

🤖 Generated with Claude Code

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.
@meaku meaku requested a review from jhnns April 15, 2026 08:59
@jhnns jhnns merged commit ef670c7 into main Apr 15, 2026
1 check passed
@jhnns jhnns deleted the docs/upstream-remote-safety branch April 15, 2026 19:55
@jhnns
Copy link
Copy Markdown
Member

jhnns commented Apr 15, 2026

Merged without testing 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants