Git Stash Without the Branch Name

I found a way to stash changes in git without including the branch name in the stash message. This might be a very niche use case but it&rsquo;s been a minor annoyance for me for some time. If you just want the alias, then add the following to your .gitconfig : [ alias ] sm = '!f() { git stash || exit 1; rev= $( git rev-parse stash@ { 0 } ) && git stash drop stash@{0} || exit 1; git stash store -m…