Feat(multi-store users): Deploy theme changes across multiple stores without manual conflict resolution #6505
Closed
lmcrean wants to merge 3 commits intoShopify:mainfrom
Closed
Feat(multi-store users): Deploy theme changes across multiple stores without manual conflict resolution #6505lmcrean wants to merge 3 commits intoShopify:mainfrom
lmcrean wants to merge 3 commits intoShopify:mainfrom
Conversation
- Introduced `git-merge-preserve` command to handle merges for environment-specific files. - Added `git-setup` command to configure Git for multi-environment theme development. - Updated `.gitattributes` to include environment-specific merge strategies. - Implemented tests for new commands and merge strategies. - Enhanced documentation in README for new commands and usage instructions.
Author
|
it's ready @isaacroldan @amcaplan @gonzaloriestra -- any chance of a review please? |
- Adjusted package versions in pnpm-lock.yaml, including downgrading esbuild to 0.25.5 and updating nx to 21.5.2. - Modified oclif.manifest.json to enhance command descriptions and flags, including the addition of new commands for notifications and cache management. - Updated README.md to reflect changes in command usage and flags for better clarity. - Cleaned up unnecessary eslint-disable comments in typescript files for improved code quality.
- Removed unnecessary dependencies from pnpm-lock.yaml to streamline package management. - Updated the default path in oclif.manifest.json to reflect the correct project structure.
Contributor
|
Hi 👋 Thanks so much for your interest in this issue and for the significant effort you've put into this pull request. While we appreciate the work, the approach proposed here unfortunately doesn't align with the direction we're planning for this area of the project. It's also unfortunate that we can't prioritize this issue at the time but it's already tracked by the team 🙏 Thanks again for all the work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.jsonand 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