tm1cm · Walkthrough 3 of 5
Promote a change with git
You keep the model in git, make a change, and put on the next server exactly the files that change touched, deleted ones included. Here the change is to PriceCube's rules, with an old view removed.
Before you start
- A project with the model in it: Set up a project and get your model. This one has two environments,
testandprod. Here both point at the same SData sample; yours are different servers.
Steps
Commit the model as it is. A project is an ordinary git repository:
Terminal
git init -q && git add . && git commit -q -m "The model as it is on test"PowerShell
git init -q; git add .; git commit -q -m "The model as it is on test"Nothing is left to commit: the log and
credentials.yamlare in the scaffold's.gitignore.Terminal
git status --shortMake the change and commit it. Edit the files, or change the model on
testandgetit again. Here a line is added to a rule, and a view is deleted:Terminal
echo "# Reviewed for the 2027 budget" >> data/rule/PriceCube.rule git rm -q data/view/SalesCube/Trace_simple.view git commit -q -am "Review PriceCube's rules, drop an old view"PowerShell
Add-Content data/rule/PriceCube.rule "# Reviewed for the 2027 budget" git rm -q data/view/SalesCube/Trace_simple.view git commit -q -am "Review PriceCube's rules, drop an old view"Review it. The change is the files the commit touched, which is what a pull request shows a reviewer:
Terminal
git diff --name-only HEAD~1 -- dataOutput
data/rule/PriceCube.rule data/view/SalesCube/Trace_simple.viewPut exactly that commit on
prod. Given files, tm1cm moves only their objects, whatever the filters intm1cm.yamlsay, and a file that's gone deletes its object:Terminal
git diff -z --name-only HEAD~1 -- data | xargs -0 tm1cm --mode put --environment prodOutput
… 10 lines before 2026-01-01 09:00:00,000 - tm1cm.tm1 - connect(213) - INFO - Connected to TM1 11.8.03500.6 at http://localhost:8011 as Basic admin 2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation UPDATE_RULE: PriceCube 2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation DELETE_VIEW: SalesCube:Trace_simple 2026-01-01 09:00:00,000 - skipcheck_tm1 - close(400) - INFO - Closed TM1 session 11 at http://localhost:8011/api/v1/PowerShell
tm1cm --mode put --environment prod (git diff --name-only HEAD~1 -- data)Output, as on macOS
… 10 lines before 2026-01-01 09:00:00,000 - tm1cm.tm1 - connect(213) - INFO - Connected to TM1 11.8.03500.6 at http://localhost:8011 as Basic admin 2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation UPDATE_RULE: PriceCube 2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation DELETE_VIEW: SalesCube:Trace_simple 2026-01-01 09:00:00,000 - skipcheck_tm1 - close(400) - INFO - Closed TM1 session 11 at http://localhost:8011/api/v1/The rule is updated and the view deleted, and nothing else is touched.
Put one file the same way:
Terminal
tm1cm --mode put --environment prod data/rule/PriceCube.ruleOutput
… 10 lines before 2026-01-01 09:00:00,000 - tm1cm.tm1 - connect(213) - INFO - Connected to TM1 11.8.03500.6 at http://localhost:8011 as Basic admin 2026-01-01 09:00:00,000 - main - main(75) - INFO - Performing operation UPDATE_RULE: PriceCube 2026-01-01 09:00:00,000 - skipcheck_tm1 - close(400) - INFO - Closed TM1 session 13 at http://localhost:8011/api/v1/
Putting everything
tm1cm --mode put --environment prod, with no files, puts every object tm1cm.yaml includes: it compares the files with the server, and changes only what differs, deleting what the server has and the files don't. Run a get from that server into another folder first to see what it has, or use the interactive shell to look at the differences before doing them.
What's next
Run it from CI, so that a merged pull request is put on the server.
Next
- Pick changes in the interactive shell: See what differs between two environments, and do only the changes you pick.
All the settings, filters, options and exit codes are in the reference.