dotfiles/git/.config/zsh/alias.d/git-stash-push.sh
Marty Oehme bb9030f885
bash: Fix git stash alias setting
Fixed bash alias loading for additional modules by loading both general
sh aliases as well as individual bash aliases.

Moved git stash push/save aliasing to split between bash/zsh shell since
zsh can check for the correct version of git to invoke push command
(only part of git since 2.13) and bash simply falls back to save.
2021-07-07 10:24:04 +02:00

14 lines
304 B
Bash

#!/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