Skip to content
Edit this page

Configure a project and your defaults

git-tpl separates shared rendering inputs from personal preferences. The configuration reference defines every field and its precedence.

Project settings

git tpl init creates .config/git.tpl.toml in the project. Commit this file: it records the template source, requested revision, answers, and composed-child locks. Change an answer there, then review and merge the next rendering:

git tpl update
git tpl diff
git tpl merge

Use git tpl switch <source> to change templates while retaining rendered ancestry. Changing an attachment ID by hand creates a different rendered ref.

Personal defaults and shortcuts

Create ~/.config/git-tpl/config.toml (or $XDG_CONFIG_HOME/git-tpl/config.toml):

#:schema https://noirbizarre.github.io/git-tpl/user.schema.json

[defaults]
author = "Your Name"

[shortcuts]
gh = "https://github.com/"

[trust]
templates = ["github.com/myorg/*"]

Defaults pre-fill interactive prompts; they do not replace template defaults in noninteractive runs. Shortcuts expand only command-line sources, before the resolved URL is recorded. Trust entries authorize declared network capabilities of matching templates.

Git preferences

Use Git configuration for preferences that already fit its local/global precedence:

git config tpl.remote upstream
git config --global tpl.interactive false

For automation, prefer explicit answers or answer files and --defaults. See the reference for Git preferences.

Editor validation

Newly serialized project configurations include this TOML schema comment:

#:schema https://noirbizarre.github.io/git-tpl/project.schema.json

Add it manually to an older project configuration if desired. Use the user.schema.json directive above for personal configuration. Editors supporting TOML JSON Schema associations can then offer completion and structural validation. You can also save a schema locally and associate the file through your editor's configuration for offline use.

The editor may download the schema; git-tpl does not. Schemas follow published main and do not replace runtime checks or validate a specific template's answer choices. See schema scope and limitations.