Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Last active October 23, 2024 10:43
Show Gist options
  • Save igrigorik/6666860 to your computer and use it in GitHub Desktop.
Save igrigorik/6666860 to your computer and use it in GitHub Desktop.
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@joeflack4
Copy link

joeflack4 commented Jun 4, 2022

@drewbo worked for me on mac, thanks

Edit: Well, I don't actually want to use this, because when I source my .bash_profile now, I get this as a result:

fatal: not a git repository (or any of the parent directories): .git

@mathieux51
Copy link

With Github CLI, this is exactly what I was looking:

gh browse .

Thanks @yohanb 🙏

@giovannipcarvalho
Copy link

Quick and dirty if you already have the vim plugin rhubarb installed:

vim +GBrowse +q

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