bash: gc: setze Upstream bei Checkout
This commit is contained in:
parent
abf3ae5e03
commit
800ab35760
1 changed files with 5 additions and 15 deletions
18
.bash_extra
18
.bash_extra
|
@ -180,8 +180,10 @@ Options:
|
||||||
Author:
|
Author:
|
||||||
michael.grote@posteo.de - git.mgrote.net
|
michael.grote@posteo.de - git.mgrote.net
|
||||||
EOF
|
EOF
|
||||||
;; --new-branch | -b)
|
;;
|
||||||
(git checkout --quiet -b "$2" > /dev/null 2>&1 && echo '>>> Create new branch "'"$2"'"') ||
|
--new-branch | -b)
|
||||||
|
REMOTE=$(git remote | head -n 1)
|
||||||
|
(git checkout --quiet -b "$2" && git push --set-upstream "$REMOTE" "$2" && echo '>>> Create new branch "'"$2"'"') ||
|
||||||
(git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ')
|
(git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -189,18 +191,6 @@ EOF
|
||||||
(echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch!")
|
(echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch!")
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
function ll {
|
|
||||||
if command -v exa >/dev/null ; then
|
|
||||||
exa --long --git --all --ignore-glob='.git' --group-directories-first --sort=name --group "$@"
|
|
||||||
else
|
|
||||||
ls -lah "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
function gs {
|
|
||||||
echo "* = unstaged // + = staged // $ = stashed // % = untracked"
|
|
||||||
git status --show-stash
|
|
||||||
}
|
|
||||||
|
|
||||||
### Aliase
|
### Aliase
|
||||||
# tmux
|
# tmux
|
||||||
alias tmuxa="tmux a -t "
|
alias tmuxa="tmux a -t "
|
||||||
|
|
Loading…
Reference in a new issue