Repository navigation
Description
Feature Request: New Conflict Resolution Mode – Stash Conflicts
Summary
Introduce a new conflict-handling strategy (StashConflicts) to git-sync that automatically stashes only the conflicting lines/regions when a merge conflict is detected, allowing non-conflicting changes to be synced normally. This enables seamless background syncing while surfacing conflicts for later resolution, without blocking further changes or normal syncs.
Motivation
Current conflict handling in git-sync is limited to either creating a fallback branch or requiring manual intervention. With growing collaboration and automated workflows, users benefit greatly from being able to continue syncing non-conflicting changes while deferring the manual resolution of conflicts to a more convenient time. Integrating with the new three-way merge editor in the UI (merge branch) makes this workflow practical and user-friendly.
Proposed Design
-
Add a new enum:
ConflictHandlingModewith three values:Manual(fail on conflict, require user intervention)ConflictBranch(existing fallback branch mode)StashConflicts(new: stash only conflicting lines/regions)
-
Stash only conflicting lines/regions: On detecting a conflict during
git pull/sync, automatically stash only the conflicting hunks in affected files, using a stash message with an identifiable prefix (e.g.,git-sync/conflict: <timestamp>).- All non-conflicting local changes should be incorporated into the sync as usual.
- Stashed regions should be detectable by git-sync and surfaced to the user as unresolved conflicts.
- Multiple stashes can be created if subsequent conflicts occur; all should be tracked and displayed.
-
UI Integration:
- The presence of unresolved conflict stashes will put the repository into a special UI state (not a sync error), much like how fallback branches are surfaced.
- The repo should remain fully usable, with normal syncs continuing (except for the stashed regions).
- The UI should present a clear indicator of the repository's conflict stash state (e.g., a custom sync state such as
conflict-stash) and allow the user to open the three-way merge editor to resolve stashed conflicts at their convenience.
-
Stash detection: Use a stash message format similar to the fallback/conflict-branch prefix:
git-sync/conflict: <timestamp>for easy programmatic discovery and management.
Points to Consider
- Stash granularity: Native Git stashes operate at the whole-file level; stashing only the conflicting hunks likely requires custom logic. Is this possible to do via plumbing commands, or does it require a partial index/patch workflow?
- Re-stashing: When another conflict occurs while one or more conflict stashes are already present, simply create another stash. All should surface in the UI until resolved.
Benefits
- Continuous background syncing, even in the face of conflicts
- Improved editor experience—resolve conflicts when convenient, not immediately forced
- Clear UI indicating unsynced/conflicting changes, with direct access to resolve them
Activity
michaelhthomas commentedon Apr 8, 2026
jamieatcognito Thoughts on this plan?
jamieatcognito commentedon Apr 15, 2026
Conceptually great, even better than I'd hoped since it might even allow continued syncing of non-conflicting areas of the file if I am reading this correctly. My big concern is how conflicts are surfaced (some type of taskbar notification that can be dismissed if necessary so there is immediate awareness) and how they are resolved (per file high level Keep My Changes, Keep Their Changes, Keep Both, Interactive Revenue) so that there is an "easy button" option that does not require the user to look at the three-pane merge experience unless they are not certain whose changes to keep. Often conflicts will occur when the parties are actually in meetings together, not async, so they likely just need to know they are butting heads and work it out. We are starting to use this tomorrow as is, but this will be a huge improvement.