Created
August 31, 2024 19:15
-
-
Save lakrizz/7f137029dc85bcde3da4cf40703dacb5 to your computer and use it in GitHub Desktop.
gh cli / fzf - select an issue and this script automatically creates a branch linked to the issue and checks it out, put this in your `.<shell>rc`
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
alias gcib="repo=\$(basename \$(git rev-parse --show-toplevel)) && remote_url=\$(git config --get remote.origin.url) && [[ \$remote_url =~ github\.com[:/] ]] && repo_path=\${remote_url##*github.com[:/]} && issue=\$(gh issue list --repo \${repo_path%.git} --limit 100 --json number,title --template '{{range .}}{{.number}}: {{.title}}{{\"\n\"}}{{end}}' | fzf) && [[ -n \$issue ]] && gh issue develop \$(echo \$issue | cut -d: -f1) --repo \${repo_path%.git} --checkout" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment