Skip to main content
Git sync is a Git feature that allows you to tie your local project to a remote repo. When Git sync is enabled, you will only be able to pull in changes from the remote repository. Git sync is particularly useful for deployment— for example if you’d like a hosted Mage instance to stay up-to-date with a repo. Running a Git sync will overwrite all local changes and replace them with the code in the specified remote branch. Git syncs can be run either from the Git settings page, or before every trigger run if you selected the Sync before each trigger run field. To enable Git Sync, first configure Git in Mage, then navigate to the settings page and tick the Git Sync box.

Syncing git submodules

Repositories synced through Mage will only update 1 level of submodules. If your submodule contains other submodules, you will need to manually update them or reformat your submodules. If your repo contains git submodules, you can enable syncing for them by ticking the Include submodules box. Mage will use the same credentials that are provided for the main repository to update the submodules.

Git sync settings as environment variables

For Mage versions >= 0.9.51Mage will prioritize git settings from environment variables when they are set. If you want to be able to change git settings from the UI, you will need to set the GIT_OVERWRITE_WITH_PROJECT_SETTINGS environment variable to 1. Otherwise, edits to the git settings from the UI will not be applied.
You can choose to pass in Git settings as environment variables. Mage will read from these environment variables to configure your Git repo.