2021-07-07 08:24:04 +00:00
|
|
|
#!/usr/bin/env zsh
|
2021-07-08 10:11:23 +00:00
|
|
|
# shellcheck shell=sh
|
2021-07-07 08:24:04 +00:00
|
|
|
|
|
|
|
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
|