GitHub CLI: Open current branch in GitHub
7 July 2023 (Updated 7 July 2023)
Make sure the GitHub CLI is installed and then add some bash (~/.bashrc
) or ZSH aliases (~/.zshrc
):
alias gbranch="git symbolic-ref --short HEAD"
function gview() {
gh browse -b $(gbranch)
}
Source your .bashrc
or .zshrc
files and then run the below from any folder that has Git initialised:
gview
Tagged:
GitHub
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment