Skip to content

Instantly share code, notes, and snippets.

@jasonm23
Created July 23, 2014 05:54
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 jasonm23/40a9f68278882ee0cb24 to your computer and use it in GitHub Desktop.
Save jasonm23/40a9f68278882ee0cb24 to your computer and use it in GitHub Desktop.
# Show the current working branch...
gwb(){
git branch |\
sed -n '/\* /s///p'
}
# Show the current working branch stripped of pivitol id, and spaced
# (instead of dashed)
gwbstrip(){
git branch |\
sed -n '/\* /s///p' |\
sed 's/-/ /g' |\
sed 's/[0-9]*$//'
}
# Pivotal id scraped from current branch name
gpivid(){
git branch |\
sed -n 's/^\* .*-\([0-9]*\)$/\1/p'
}
# Git commit with message inline, no quotes required.
gcmq(){
out=""
for a in "$@"
do
out="$out $a"
done
git commit -m "$out"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment