Skip to content

Version control and deploying

All of this is opt-in: turn on Use git in Settings, or t4 config set use_git yes. With git off, t4 save explains how to turn it on, a push is not checked for commits, and a diff compares with T4.

A push writes straight into the CMS database. T4 keeps its own per-record history, but it lives behind the UI and says nothing about why a change was made or what else went with it. So the record of a deployment is kept on this side, in the repository the pulled source already sits in:

Terminal window
t4 save -m "Narrow the promo box gutter on mobile"
t4 push

t4 save stages the environment’s pulled source and commits it. The message it writes names the T4 record behind each file, because a reviewer looking at contentLayout/promo-boxes--texthtml.html cannot otherwise tell which record that is:

Narrow the promo box gutter on mobile
t4-source/test/contentLayout/promo-boxes--texthtml.html -> layout #975973 (text/html)
T4-Env: test

t4 push refuses to deploy a file that is not committed. The check runs after the comparison, so it names the files actually about to go out, not everything that happens to be dirty in the tree.

It is set per environment, because the answer differs: test is where you iterate, and a commit per experiment is friction you will route around; production is where the record of what shipped matters most.

"environments": {
"test": { "push_allowed": true, "require_commit": false },
"prod": { "push_allowed": false, "require_commit": true }
}

An environment’s own setting wins; a project-level require_commit is the default for any that do not say; absent both it is on, because the safe default is the one you have to opt out of. --allow-dirty skips it for a single run. With use_git on, a project that is not a git repository is not blocked, but it says so rather than deploying untracked work silently.

Each successful push appends a line to .t4/deployed.jsonl recording the file, the T4 record, and the commit it was deployed from, and .t4/history.jsonl records what was pulled, pushed, committed and mirrored, and when. Both are local to your checkout (.t4/ is not committed), so they answer “what did this machine do”, which is the question they can answer honestly.

t4 status shows the repository state alongside everything else.

Only t4-source/. .t4/ holds the CMS URLs you work against, your API token, and the local logs above. Committing it means a clone carries someone else’s environment, and eventually a credential however careful the ignore rules are. t4 init writes a .gitignore that keeps it out, along with the mirror and the raw API responses: all regenerable, and the mirror is large.

So a colleague starting from a clone does:

Terminal window
git clone <repo> && cd <repo>
t4 init # their own .t4/
t4 env add test https://myweb-test.example.edu
t4 token set test # their own credential
t4 serve # mirrors, then serves

The source is already there from the clone, so there is nothing to pull before they can look at it. A pull only becomes necessary when T4 has moved on.

An independent, unofficial tool. Not produced, endorsed or supported by TERMINALFOUR Solutions Ltd, and not TERMINALFOUR software. “T4” and “TERMINALFOUR” are their trademarks, used here only to identify the software this works with. Copyright © 2026 Small Robot Corp. Source available under the PolyForm Shield License 1.0.0.