Skip to content

Instantly share code, notes, and snippets.

@lukeocodes
Last active June 4, 2022 10:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeocodes/cd896c8fc53f5f777063d85800f80113 to your computer and use it in GitHub Desktop.
Save lukeocodes/cd896c8fc53f5f777063d85800f80113 to your computer and use it in GitHub Desktop.
Github CLI alias to create a branch from GitHub Issue
gh alias set issueBranch --shell \
'title="$(gh issue view $1 --json title --jq .title)"; \
slug="$(source $HOME/.zshrc && slugify "$title")"; \
git checkout -b "prefix-$1.$slug"'
@cbandera
Copy link

Prerequisit: slugify (install with e.g. sudo apt install slugify)

Use as e.g. gh issueBranch 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment