News for hackers. Stuff that matters.
Re:Lesser known Git commands by geofft on Friday September 30, 2016 @12:19PM (#12613391)
So branch to a temporary branch, commit, checkout the branch you wanted to be on, cherry-pick the temporary branch to grab its head commit, then delete the temporary branch once you're sure you don't need it.

This isn't completely safe because deleting a branch also deletes its reflogs, but it does avoid use of the stash command at all, which I find good for my own safety (because it reduces cognitive load). And it scales obviously to making multiple commits onto the temporary branch, etc.

Re:Lesser known Git commands by eridius on Friday September 30, 2016 @01:08PM (#12613709)
Or even just branch, commit, rebase onto the desired branch.