dotfiles/git/.config/zsh/alias.d/git-stash-push.sh

15 lines
304 B
Bash
Raw Normal View History

#!/usr/bin/env zsh
if ! exist git; then
return 1
fi
# git alias
# if git is at least version 2.13, we can use git stash push
autoload -Uz is-at-least
if is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')"; then
alias gsta='git stash push'
else
alias gsta='git stash save'
fi