Skip to content

Instantly share code, notes, and snippets.

@justinbarry
Last active August 29, 2019 19:57
Show Gist options
  • Save justinbarry/1319894b23dbdf81bf30eb52af67d2ff to your computer and use it in GitHub Desktop.
Save justinbarry/1319894b23dbdf81bf30eb52af67d2ff to your computer and use it in GitHub Desktop.
A git helper that creates a branch name based on a github issue title
#!/bin/bash
((!$#)) && echo Issue number provided, command ignored! && exit 1;
TITLE=$(hub issue show -f %t $1);
ESCAPED_TITLE="GH-$1-${TITLE// /-}";
git checkout -b $ESCAPED_TITLE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment