Downloads a branch’s templates, properties and resources into a folder and starts tracking them. This is how every MMT working folder starts. Checkout uses a remote to know which store and branch to download.
Before you begin#
- Add a credential and a remote.
- The folder can be new or existing. MMT doesn’t check whether it’s empty, and files it writes replace files with the same name, so use an empty folder unless you’re using
--reinitialize.
Usage#
mmt checkout [-c CHANGESET] [--ignore-unsynced-templates] [--ignore-unsynced-properties] [--include-hidden-settings] [--reinitialize] remote-key [path]
Arguments#
| Argument | Short | Required | Description |
|---|---|---|---|
-c CHANGESET |
No | Checkout a specific changeset. If omitted the last changeset is used. | |
--ignore-unsynced-templates |
-t |
No | Ignore templates that do not have the sync flag. |
--ignore-unsynced-properties |
-p |
No | Ignore properties that do not have the sync flag. |
--include-hidden-settings |
-s |
No | Include hidden settings in the managed template and managed property settings files. |
--reinitialize |
-z |
No | Reinitialize the state file to the specified changeset. Files that do not exist are added while files that already exist are left unmodified. |
remote-key |
Yes | The key associated with the stored remote resource. | |
path |
No | The path where the checked out branch should be created. |
Examples#
Check out the latest changeset into a new folder:
mmt checkout mystore-dev ./mystore-dev
Check out changeset 142 instead of the latest:
mmt checkout -c 142 mystore-dev ./mystore-dev-142
Rebuild the tracking data for a folder that already has your files in it, without overwriting them:
mmt checkout --reinitialize mystore-dev .
What checkout does#
- Finds the remote’s branch on the store and the changeset to use (the latest, or the one given with
-c). - Writes every template, property, JavaScript resource, CSS resource and resource group in that changeset. See Checkout folder layout.
- Saves the remote and the checkout options in
.mmt/config.json, and a hash of every file in.mmt/state.json.
It prints nothing when it succeeds. Run mmt status afterwards: it should say No files modified.
-tand-pkeep only templates or properties whose sync flag is on, and leave the rest out. They don’t affect resources or resource groups.- By default, settings whose names start with
.(hidden settings) are left out of template and property.jsonfiles.-skeeps them. - These three options are saved with the checkout, and
pullandswitchkeep using them. -zwrites files that don’t exist yet and leaves existing files alone. Files that differ from the branch then show as modified, ready to push. Use it to recover a lost.mmtfolder or to start tracking a folder of files you already have.- With
-c, you can look at an older changeset, but a latermmt pushstill commits on top of the branch’s latest changeset.