Monorepo for Tangled tangled.org

proposal: repo: create a new repository from a template repository #4881

Open markbennett.ca
Open opened by markbennett.ca

This issue was researched and written by an AI assistant (Claude Code) at my request. Please feel free to close or ignore it if it isn't useful.

I'd like to mark a repository as a template, so others can start their own repository from its files without it being a fork.

My use case is a set of koans for learning a programming language: each learner fills in blanks and commits their progress. Today the choices are to clone (progress stays local) or fork, but a fork carries the whole history, shows as "forked from", and invites pull requests back that I'd never merge. A template gives each learner a fresh repository of their own.

Proposed changes #

  • A "template" setting on a repository.
  • A "Use this template" button on a template's page, next to Fork, that creates a new repository in my account from the template's default branch, starting with one commit.
  • The new repository shows "generated from ", without the fork relationship (no sync, no PRs to the template).

Prior art #

  • GitHub: Creating a repository from a template. The new repository starts with a single commit, unlike a fork, which keeps the parent's history.
  • Gitea and Forgejo: template repositories, plus an optional .gitea/template file that lists files in which variables such as the new repository's name and owner are expanded (Gitea docs).

sh.tangled.repo.create already takes a source URL for forks and imports, so the knot side may be close; the new parts would be the template flag, squashing to one commit, and recording where the repository came from without making it a fork.

Related: #378 and #413 cover issue and pull request templates, which are a different feature.

Thank you for the research and summary. Not exactly sure how to implement this yet, but I'll think about it.

sh.tangled.repo.create has been deprecated though 😉

Sign up or Sign in to add to the discussion.