Add this snippet to your .*shrc
.
gx() {(
set -e
# If working tree dirty bar staged content...
if git status --porcelain | grep -v '^. ' >/dev/null; then
echo "⮑ Temporarily stashing unstaged and untracked content."
git stash push --keep-index --include-untracked
unstash() {