diff --git a/.gitconfig b/.gitconfig index 49f72b6..b6f02ef 100644 --- a/.gitconfig +++ b/.gitconfig @@ -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 diff --git a/scripts/git_checkout b/scripts/git_checkout index cd854be..ceda725 100755 --- a/scripts/git_checkout +++ b/scripts/git_checkout @@ -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! ")