Only alias to git status -sb on supported git version
This commit is contained in:
parent
8aca01d137
commit
827272edc8
1 changed files with 9 additions and 1 deletions
|
|
@ -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" }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue