4 ms·
I think this should work fine (modulo typical git ui infelicities; but you can certainly make an alias that does it). How about something along the lines of:
by patrec 6y ago
I think this should work fine (modulo typical git ui infelicities; but you can certainly make an alias that does it).
How about something along the lines of:
git stash --keep-index
git stash
git checkout right-branch
git stash pop --index
git stash pop
? Untested, so I might have messed up a detail.
Another alternative is creating a tmp branch (again untested) and cherry-picking (with --no-commit) across.
git checkout -b tmp
git commit -m 'staged'
git commit -am 'unstaged'
git checkout right-branch
git cherry-pick -n tmp
git reset HEAD
git cherry-pick -n tmp^
git branch -D tmp