git tpl push¶
Publish template refs to a remote.
Pushes refs/tpl/<id> explicitly:
Why this is a separate command¶
Rendered refs are never pushed implicitly. git push does not push them, and
nothing git-tpl does changes what git push sends.
The two modes this gives you are both first-class:
Nobody else needs it. The template attachment is fully described by
.config/git.tpl.toml, which is pushed — so a collaborator can run
git tpl update and render an identical ref for themselves.
Never forced¶
$ git tpl push
To github.com:acme/my-project
* [new ref] refs/tpl/github-com-noirbizarre-rust-library-template -> refs/tpl/github-com-noirbizarre-rust-library-template
Divergence¶
$ git tpl push
Cannot push refs/tpl/github-com-noirbizarre-rust-library-template: the remote copy has diverged.
local 4f2c1a9 (2 commits not on the remote)
remote 9a8b7c6 (1 commit not local)
Both were rendered independently. Reconcile them first:
git tpl fetch
git merge refs/remotes/origin/tpl/github-com-noirbizarre-rust-library-template
git tpl push
There is no --force. A rendered ref is history that others may have merged
from, and overwriting it destroys the merge base their branch depends on — which
turns their next update into a whole-file conflict.
Reconciling is a merge, like everything else here. The rendered tree is deterministic, so two renderings of the same template revision with the same answers merge without conflict; if they do conflict, the answers genuinely differ and that is worth seeing.
Options¶
| Option | Meaning |
|---|---|
--remote <name> |
Default origin, or tpl.remote. |
--dry-run |
Report what would be pushed. |
Pushing automatically after an update¶
Or per-invocation, git tpl update --push.