git: add autoSetupRemote
Signed-off-by: Michael Grote <michael.grote@dataport.de>
This commit is contained in:
parent
2dedcfda5a
commit
6c0afe7a41
2 changed files with 3 additions and 2 deletions
|
@ -13,7 +13,8 @@ autocorrect = 20 # https://opensource.com/article/20/11/git-aliases
|
|||
[status]
|
||||
showUntrackedFiles = all
|
||||
[push]
|
||||
default = simple
|
||||
default = current
|
||||
autoSetupRemote = true
|
||||
[pull]
|
||||
rebase = true
|
||||
autostash = true
|
||||
|
|
|
@ -18,7 +18,7 @@ case "$1" in
|
|||
EOF
|
||||
;;
|
||||
--new-branch | -b)
|
||||
(git checkout --quiet -b "$2" && git push --set-upstream "$(git remote | head -n 1)" "$2" && echo '>>> Create new branch "'"$2"'"') || (git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ')
|
||||
(git checkout --quiet -b "$2" && echo '>>> Create new branch "'"$2"'"') || (git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ')
|
||||
;;
|
||||
*)
|
||||
if [ -n "$1" ] ; then (echo ">>> Try local checkout" && git checkout --quiet "$1" > /dev/null 2>&1) || (echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch! ")
|
||||
|
|
Loading…
Reference in a new issue