Skip to content

Instantly share code, notes, and snippets.

@mauriciomutte
Last active August 24, 2022 19:46
Show Gist options
  • Save mauriciomutte/f1f8a29fcf44adf0f1405a8cc092c3f3 to your computer and use it in GitHub Desktop.
Save mauriciomutte/f1f8a29fcf44adf0f1405a8cc092c3f3 to your computer and use it in GitHub Desktop.
Generate GH CLI alias to improve productivity
#!/bin/sh
# open repository in browser
gh alias set --shell web \
'gh repo view --web'
# get the current branch/PR infos
gh alias set --shell prinfo \
'gh pr view --json title,number --template "\"$(printf "#%v"){{.number}}\" \"{{.title}}\""'
# create a new PR for DEV and QA branches
gh alias set --shell prdevqa \
'gh pr create -a @me -B "release/qa" -b $1 -l "release/qa" -t "[QA] $2" && \
gh pr create -a @me -B "develop" -b $1 -l "develop" -t "[DEV] $2" && \
gh pr list --web'
@rbalves
Copy link

rbalves commented Aug 24, 2022

❤️

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