bash: add gco function
Anirudh Oppiliappan x@icyphox.sh
Tue, 15 Feb 2022 15:48:19 +0530
1 files changed,
11 insertions(+),
0 deletions(-)
jump to
M
bash/.bashrc.d/90-aliases.bash
→
bash/.bashrc.d/90-aliases.bash
@@ -39,6 +39,17 @@ gpm() {
git pull -r origin master } +gco() { + [[ "$1" == "" ]] && return 1 + + git rev-parse --verify "$1" &> /dev/null + if [ $? -eq 0 ]; then + git checkout "$1" + else + git checkout -b "$1" + fi +} + ls() { case "$OSTYPE" in "darwin"*)