Feat(multi-store users): Deploy theme changes across multiple stores without manual conflict resolution #6505
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unique store settings are preserved via configured Git merge drivers.
Problem
Fixes #3509
When working with themes across multiple stores, developers encounter merge conflicts in
config/settings_data.json
and other configuration files because each store has different settings (store names, payment configs, branding, regional preferences, app configurations).Problematic workflow (before this fix):
Users are forced into the complex separate-branch approach because Shopify's GitHub integration pushes store-specific customizations (made by store admins) back to branches, making a unified single-branch workflow impossible. The result: developers must manually resolve the same settings conflicts repeatedly across multiple stores.
These conflicts require manual resolution every time, which is time-consuming and error-prone.
Solution
Custom Git merge drivers that automatically preserve the current branch's settings during merges:
Usage
Note: This solution makes the separate-branch approach work smoothly. While users ideally want a single branch for all stores, our solution makes the current multi-branch reality much more manageable by eliminating manual conflict resolution.
Implementation
New Commands:
shopify theme git-setup --multi-environment
- Configure merge strategiesshopify theme git-setup --status
- Check configurationshopify theme git-setup --reset
- Remove configurationshopify theme git-merge-preserve
- Internal merge driverFiles:
git-setup.ts
- CLI command for setupgit-merge-preserve.ts
- Git merge drivergit-config.ts
- Git configuration managementtheme-merge.ts
- Custom merge logicTesting
✅ 53 comprehensive tests covering all functionality
✅ Build, lint, and type checking pass
✅ Manual testing with real Git repositories validates merge preservation
Benefits
Future Considerations