Skip to content

Instantly share code, notes, and snippets.

@sebastienwindal
Last active November 25, 2019 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastienwindal/c14af6fdddf9a348662e8c0675d20d8a to your computer and use it in GitHub Desktop.
Save sebastienwindal/c14af6fdddf9a348662e8c0675d20d8a to your computer and use it in GitHub Desktop.
git command line shortcuts

br

echo -e "> \033[1;92m git branch\033[0m"
git branch | nl

co

BRANCHINDEX=`echo $1 | xargs`
BRANCHNAME=`git branch | sed -n "$BRANCHINDEX p" | sed "s/\*//g"`
echo -e "> \033[1;92m git checkout $BRANCHNAME\033[0m"
git checkout $BRANCHNAME

db

BRANCHINDEX=`echo $1 | xargs`
BRANCHNAME=`git branch | sed -n "$BRANCHINDEX p" | sed "s/\*//g"`
echo -e "> \033[1;92m git branch -d $BRANCHNAME\033[0m"
git branch -d $BRANCHNAME

p

echo -e "> \033[1;92m git pull\033[0m"
git pull

st

echo -e "> \033[1;92mgit status\033[0m"
git status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment