Skip to content

Instantly share code, notes, and snippets.

@mkf-simpson
Created June 30, 2014 11:12
Show Gist options
  • Save mkf-simpson/6abdd838bb0177614dc5 to your computer and use it in GitHub Desktop.
Save mkf-simpson/6abdd838bb0177614dc5 to your computer and use it in GitHub Desktop.
task number from branch name
#!/usr/bin/env bash
branch=$(git symbolic-ref --short HEAD)
branch_description=$(echo $branch | cut -f2 -d/)
prefix=$(echo $branch_description | cut -f1 -d-)
number=$(echo $branch_description | cut -f2 -d-)
git commit -am "$prefix-$number $1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment