DEV Community

Discussion on: Nice tip - open your Github project page from CL

Collapse
 
autoferrit profile image
Shawn McElroy

In Linux there's no open command. You should be able to do this if your default browser is set

alias gh="$BROWSER $(git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\)"

It may work on osx as well if you set $BROWSER in your terminal somewhere. Note, I'm on my phone so I couldn't try this but it should be right

Collapse
 
kethmars profile image
kethmars

Oh wow! Thank you! I edited the article, specified environments and added your script there.