Last active
June 4, 2022 10:54
-
-
Save lukeocodes/cd896c8fc53f5f777063d85800f80113 to your computer and use it in GitHub Desktop.
Github CLI alias to create a branch from GitHub Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisit:
slugify
(install with e.g.sudo apt install slugify
)Use as e.g.
gh issueBranch 1