.mdx
sync
Mprove sync allows you to sync uncommitted changes between local and dev repositories while working with project files on your local machine.
For mprove sync to work, the current git branch in the Local repository and the branch in the Dev repository must be in the same commit.
Workflows
You can change your approach depending on the task.
Workflow "Commit on Local machine":
- Make changes on Local machine
- Sync changes (mprove sync)
- Check and fix validation errors in web UI
- Sync changes using (mprove sync)
- Commit changes on Local machine
- Push changes from Local machine to Remote (git push)
- Revert Dev repo to Remote in web UI (or revert Dev repo to last-commit and pull changes from Remote)
Workflow "Commit on Dev (web UI)":
- Make changes on Local machine
- Sync changes (mprove sync)
- Check and fix validation errors (web UI)
- Commit changes on Dev (web UI)
- Push changes from Dev to Remote (web UI)
- Discard git changes on Local machine
- Pull changes from the Remote to Local machine
Usage
➜ ~ mprove sync -h
Synchronize files (uncommitted changes) between Local and Dev repo, validate Mprove Files for selected env
━━━ Usage ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$ mprove sync
━━━ Options ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
--project-id #0 (required) Project Id
--env #0 (required) Environment
--local-path #0 (optional, if not specified then the current working directory is used) Absolute path of local git repository
--first-sync (default false) if set, then the previous sync timestamp is ignored
--get-repo (default false), show repo in output
--get-repo-nodes (default false), show repo nodes in output
--get-errors (default false), show validation errors in output
--json (default false)
--debug (default false) add debug to output
--env-file-path #0 (optional) Path to ".env" file
━━━ Examples ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Synchronize files (uncommitted changes) between Local and Dev repo, validate Mprove Files for selected env
$ mprove sync --project-id DXYE72ODCP5LWPWH2EXQ --env prodExample Output
➜ ~ mprove sync \
--local-path /mprove/mprove_data/mp5 \
--env-file-path /mprove/.env \
--env prod
message: Sync completed
validationErrorsTotal: 0
url: https://app.mprove.io/org/AWNCAHWLFQTQJYCH3ZSE/project/DXYE72ODCP5LWPWH2EXQ/repo/T2SQOCM8KK2QMRYYH75N/branch/main/env/prod/builder