sync command manages bidirectional synchronization between your local Quartz content and GitHub, handling commits, pulls, and pushes automatically.
Basic Usage
- Commits your local changes with a timestamp
- Pulls updates from your GitHub repository
- Pushes your changes to GitHub
Command Options
Commit Options
Create a git commit for your unsaved changes.To skip committing:
When enabled, the sync command stages all changes and creates a commit with a timestamp before pulling or pushing.
Custom commit message (overrides the default timestamp message).Alias: Default message format:
-mQuartz sync: Jan 15, 2026, 2:30 PMRemote Sync Options
Pull updates from your Quartz fork before pushing.To skip pulling:
Push updates to your Quartz fork.The push uses force-with-lease to safely update the remote branch.To skip pushing:
Common Options
Directory containing your content files.Alias:
-dPrint extra logging information.Alias:
-vExamples
Full Sync (Default)
Commit, pull, and push all changes:Custom Commit Message
Sync with a descriptive commit message:Pull Only
Get updates from GitHub without committing or pushing:Push Only
Push local changes without pulling:Commit Without Sync
Create a commit without pulling or pushing:Sync Workflow
The sync command executes these steps in order:Content Backup
Backs up your content folder to
.quartz-cache/content-cache to ensure no data loss during the sync process.Symlink Handling
If your content folder is a symlink:
- Detects the symlink
- Dereferences it to get the actual content
- Creates a temporary copy for committing
- Restores the symlink after commit
Pull Updates (if --pull)
Pulls changes from the origin remote:May require conflict resolution if local and remote changes overlap.
Symlink Support
Quartz sync intelligently handles symlinked content folders:- Detect the symlink
- Temporarily dereference it for git operations
- Restore the symlink after committing
- Preserve timestamps and permissions
This allows you to keep your content in cloud storage (Dropbox, iCloud, etc.) while still using Quartz.
Git Configuration
The sync command uses these git remotes:origin: Your personal Quartz repository forkupstream: The official Quartz repository (for updates)
Common Workflows
Daily Content Updates
Sync After Batch Edits
Collaborative Workflow
Troubleshooting
Merge Conflicts
If you encounter merge conflicts during pull:Push Rejected
If your push is rejected:Symlink Issues
If symlink dereferencing fails:Advanced Usage
Selective Sync Operations
Commit only (no remote sync)
Commit only (no remote sync)
Pull without committing
Pull without committing
Push without pulling
Push without pulling
Integration with CI/CD
Safety Features
The sync command includes several safety mechanisms:
- Content caching: Your content is backed up before any git operations
- Force-with-lease: Prevents accidental overwrites of remote changes
- Symlink preservation: Original symlinks are restored after operations
- Timestamp preservation: File timestamps are maintained during operations
Source Code Reference
The sync command implementation:quartz/bootstrap-cli.mjs:32- Command definitionquartz/cli/handlers.js:554- Sync handler functionquartz/cli/args.js:37- Argument definitionsquartz/cli/helpers.js:24- Content stashing utilities
Next Steps
Build Command
Build your site before syncing
Deployment
Deploy your Quartz site to hosting platforms