mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-12 21:39:48 +01:00
git: use stash 'push' instead of the deprecated 'save' (#7486)
* Use stash 'push' or 'save' depending on Git version A utility function now parses the output of git --version and set the alias for git stash to 'git stash push' iff the current version of Git is 2.13 or greater; it falls back to 'git stash save' otherwise.
This commit is contained in:
commit
35dc26a2c0
1 changed files with 6 additions and 1 deletions
|
@ -239,7 +239,12 @@ alias gsps='git show --pretty=short --show-signature'
|
|||
alias gsr='git svn rebase'
|
||||
alias gss='git status -s'
|
||||
alias gst='git status'
|
||||
alias gsta='git stash save'
|
||||
|
||||
# use the default stash push on git 2.13 and newer
|
||||
[[ "$(git --version 2>/dev/null)" =~ '^git version ([0-9]+.[0-9]+)' && "$match" -ge '2.13' ]] \
|
||||
&& alias gsta='git stash push'
|
||||
|| alias gsta='git stash save'
|
||||
|
||||
alias gstaa='git stash apply'
|
||||
alias gstc='git stash clear'
|
||||
alias gstd='git stash drop'
|
||||
|
|
Loading…
Reference in a new issue