Only alias to git status -sb on supported git version

This commit is contained in:
Sami Samhuri 2010-08-11 12:06:15 -07:00
parent 8aca01d137
commit 827272edc8

View file

@ -247,7 +247,15 @@ alias pob='git-pull-origin-branches'
alias r='git remote' alias r='git remote'
alias rbi='git rebase -i' alias rbi='git rebase -i'
alias ra='git remote add' alias ra='git remote add'
GIT_VERSION="$(git --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
GIT_VERSION_MAJOR="${GIT_VERSION%%.*}"
GIT_VERSION_MINOR="${${GIT_VERSION%.*}#*.}"
GIT_VERSION_REVISION="${GIT_VERSION##*.}"
if [ $GIT_VERSION_MINOR -ge 7 ] && [ $GIT_VERSION_REVISION -ge 1 ]; then
alias s='git status -sb' alias s='git status -sb'
else
alias s='git status'
fi
git-branch-track-origin() { git branch --track "$1" origin/"$1" } git-branch-track-origin() { git branch --track "$1" origin/"$1" }