You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add active worktree sync actions, publish modal, and source ref tracking
- SPROUTGIT_SOURCE_REF env var passed to hooks (persisted via worktree_provenance table)
- Remote refs included in list_refs (upstream/* → origin/* → other remotes order)
- Source ref picker defaults to upstream-first ref when creating worktrees
- Fetch/Pull toolbar buttons now functional for the active worktree
- Push detects missing upstream and opens a Publish modal with remote selection
- Branch is deleted when its managed worktree is removed
- E2E daily-workflow test updated to reflect branch-deletion behaviour
Copy file name to clipboardExpand all lines: docs/branch-worktree-policy.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,16 @@ Remote refs are source of truth for synchronization status, but local lifecycle
132
132
- Remote state does not unilaterally force local deletion.
133
133
- Local branch deletion always requires explicit user confirmation (except future policy opt-ins).
134
134
135
+
## Upstream And Publish Policy
136
+
137
+
To avoid accidental pushes to the wrong remote branch, SproutGit uses an explicit publish model for new worktree branches.
138
+
139
+
1. On managed worktree create, upstream tracking is cleared intentionally.
140
+
2. The first push from a branch without upstream requires explicit publish setup: user selects the remote, then SproutGit runs publish semantics (`git push -u <remote> <branch>`).
141
+
3. Publish picks remote in this order: `branch.<name>.pushRemote`, `remote.pushDefault`, `branch.<name>.remote`, then `origin`, then `upstream`, then first configured remote.
142
+
4. Once upstream exists, subsequent pushes use normal `git push` behavior.
143
+
5. Source ref selection for new worktrees should prefer remote refs, with `upstream/*` ranked ahead of local branches.
0 commit comments