如何解决Crafter CMS创作环境发布内容未同步至远程Git仓库问题?
It sounds like your initial site setup connected properly to the remote repo, but subsequent changes (content types, pages, live branch) aren’t pushing through. Let’s walk through the most common fixes to get your sync working again:
1. Verify Remote Git Configuration in Studio
First, double-check that your site is set up to automatically push changes to the remote repo:
- Navigate to your Site Dashboard → Configuration → Git Configuration
- Ensure the Remote URL matches your bare repo’s address (SSH/HTTPS)
- Confirm that Auto Push Changes is enabled for both the authoring branch (usually
master/main) and the live branch - Check that the Push on Publish option is toggled on—this ensures the live branch gets pushed to the remote when you publish content
2. Validate Git Push Permissions
Since the initial commit worked, permissions might have changed or the local Crafter process lacks write access now:
- Log into the server where Crafter is running
- Navigate to your site’s repo directory:
cd crafter/data/repos/sites/<your-site-name> - Test pushing manually to surface any errors:
- For authoring changes:
git push origin master(ormain, depending on your branch name) - For live branch:
git push origin live
- For authoring changes:
- If you get authentication errors, verify SSH keys (for SSH remotes) or credentials (for HTTPS) are correctly set up for the user running Crafter Studio
3. Check Publish Job Status
Failed publish jobs can prevent the live branch from being pushed to the remote:
- Go to Site Dashboard → Publishing → Jobs
- Look for any failed jobs (marked with a red icon)
- Click into the failed job to view details, or check the studio logs at
crafter/logs/studio/studio.logfor specific error messages (e.g., merge conflicts, network issues)
4. Ensure Live Branch is Tracking Remote
Sometimes the local live branch isn’t configured to track the remote live branch:
- From your site’s repo directory, run
git branch -vvto check branch tracking status - If the live branch doesn’t show
[origin/live], set it up with:git branch -u origin/live live - Then try pushing the live branch again with
git push origin live
5. Resolve Git Merge Conflicts
If changes were made directly in the remote repo (outside Crafter), this can block pushes:
- Pull the latest changes from the remote for both branches:
git pull origin master git pull origin live - Resolve any merge conflicts that appear, commit the fixes, then try pushing again
6. Inspect Crafter Studio Logs
If none of the above works, dig into the logs for targeted clues:
- Open
crafter/logs/studio/studio.log - Search for keywords like
git push,remote, orpublishto find error messages related to sync failures - Common issues here include network timeouts, invalid repo URLs, or permission denied errors
Once you’ve addressed the root cause, try publishing a test page or content type again to confirm the sync works as expected.
内容的提问来源于stack exchange,提问作者Maros Ivanco

