Skip to content

fix: scoped pop to the current branch's stash - #73

Merged
CaddyDz merged 1 commit into
masterfrom
fix/pop-current-branch-stash
Oct 17, 2026
Merged

CaddyDz merged 1 commit into
masterfrom
fix/pop-current-branch-stash

Conversation

@CaddyDz

@CaddyDz CaddyDz commented Oct 16, 2026

Copy link
Copy Markdown
Owner

pop ran git stash pop, which takes the newest stash from any branch. Stashing on feature-a, then on feature-b, then running pop back on feature-a applied feature-b's work.

pop is now a function in .functions.sh (mac and VPS) that pops the newest stash made on the current branch. When there is none, it prints "No stash for master" (or whichever branch) and changes nothing. Use git stash pop to move a stash across branches.

Tested in zsh against both the mac and VPS files: the case above, untracked files, stashes saved with a message, newest-first among several, feat vs feat-2, branch names with / and ., detached HEAD, and outside a repo.

🤖 Generated with Claude Code

`pop` ran `git stash pop`, which takes the newest stash from any
branch. Stashing on `feature-a`, then on `feature-b`, then running
`pop` back on `feature-a` applied `feature-b`'s work.

`pop` is now a function in `.functions.sh` (mac and VPS) that pops
the newest stash made on the current branch. When there is none, it
prints "No stash for master" (or whichever branch) and changes
nothing. Use `git stash pop` to move a stash across branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CaddyDz CaddyDz self-assigned this Oct 17, 2026
@CaddyDz
CaddyDz merged commit 5924b64 into master Oct 17, 2026
1 check passed
@CaddyDz
CaddyDz deleted the fix/pop-current-branch-stash branch October 17, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant