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

15 lines
326 B
Bash

#!/usr/bin/env zsh
# shellcheck shell=sh
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