Repository navigation
Add F key to force-update branches to upstream tip - #17
Merged
Merged
Conversation
Pressing F in the picker targets the highlighted branch, or every branch marked with c, and opens a confirmation screen before running git fetch origin followed by reset --hard (worktree branches) or branch -f (plain branches). Detached worktrees are skipped and dirty targets are flagged.
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.
What
Adds an
Fkey to the picker for force-updating branches to their upstream tip.Ftargets the highlighted branch. With branches marked viac, it targets all of them.(no worktree)), warns when a target worktree is dirty, thenEnterapplies.Esc/Ctrl-C/qcancels without touching Git state or clearing marks.git fetch origin, thengit reset --hard origin/<branch>for branches with a worktree andgit branch -f <branch> origin/<branch>for plain branches. Detached worktrees are skipped; per-item failures are combined into one error.Why
wtmanages many branches across parallel worktrees; bringing a branch (or a marked batch) back to the remote tip is a common operation that otherwise means leaving the picker and running git by hand.Verification
make build fmt-check vet test-race— all pass.origintip through the picker flow.forceUpdateWith(fetch once, worktree vs plain ref update, detached skip, fetch failure, combined errors) and the UI state machine (highlighted/marked targets, confirm/cancel, dirty warning, help text).Note
git fetch originruns without--prune, so a deleted remote branch could leave a staleorigin/<branch>ref thatFwould still reset to. Can add--pruneif that case matters.