From a2af7db0ef494ae3c79f8fe4c951601407a08d9f Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 27 Dec 2021 12:25:57 +0100 Subject: [PATCH] bash: gc umgebaut --- .bash_extra | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.bash_extra b/.bash_extra index b5ebfb7..0e42cfd 100644 --- a/.bash_extra +++ b/.bash_extra @@ -134,9 +134,19 @@ function gcm { # übergibt alle argumente an git commit -m als commit nachricht git commit -m "$*" } -function gcb { - # git checkout -b lokalername origin/remotename - git checkout -b $1 origin/$1 +function gc { + case "$1" in + --help) + echo "git checkout " + echo "versucht erst einen lokalen checkout, danach von dem Remote-Repository" + echo "gc " + ;; + "") + echo "Branch fehlt..." + ;; + *) + git checkout $1 || git checkout -b $1 origin/$1 + esac } @@ -164,7 +174,6 @@ alias glast="git log -1 HEAD --stat" alias gsp="git stage -p" alias gd="git diff" alias gs="git status" -alias gc="git checkout" alias glogs="git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" # vim alias v="view"