Git sync Agency plan
Agency · Git sync is part of the Agency plan (and its free trial). Plans
Git sync keeps your snippets in a GitHub or GitLab repository, and syncs changes both ways: edit on the site or in Git (in VS Code, through a pull request, in GitHub's web editor), then sync.
- Readable files. Each snippet is a real code file, such as
disable-xml-rpc.phporbrand-colours.scss, with a small settings file next to it. Snipfire folders become folders in the repository. - Nothing is overwritten silently. A snippet changed on both sides since the last sync waits for you to choose Keep this site's or Take Git's. The version you don't keep stays in history.
- Safe on live sites. Code coming from Git is checked and test-loaded like any save. A snippet that would break the site stays switched off on that site, and the site keeps running.
- One commit per sync, with a readable message such as Snipfire: 3 changes from example.com.
- Automatic if you want. Sync on a schedule, instantly with a webhook, or from your deploy script with WP-CLI.
- Whole library or one folder. Share a Shared folder across all your client sites, while each keeps its own snippets.
Works with github.com, GitHub Enterprise Server, gitlab.com and self-managed GitLab. It talks to them over HTTPS: your server doesn't need the git program.
What you need
- Snipfire Pro on the Agency plan, or the free trial. On the Pro plan, Tools → Git sync shows an Upgrade to Agency box instead of the settings.
- Full Snipfire access (administrators have it). Git sync isn't shown to anyone else.
- A GitHub or GitLab repository, private is best, and an access token that can read and write it.
Guides
- Set up Git sync: repository, token, first sync.
- How syncing works: the files, what goes where, conflicts, deletes and broken code.
- Automatic sync, webhooks and WP-CLI
- Troubleshooting Git sync: what the messages mean.
Git sync and other features
- Every sync is in the activity log (Synced with Git, with counts and a link to the commit), and so is every snippet updated from Git.
- Changes that arrive from Git create a history version on the site, like any save.
- Settings that aren't specific to one site travel with the snippet: location, conditions, testing mode, cookie consent, on/off and so on. See What's in the files.
Something unclear or missing? Tell us