DEV Community

Discussion on: Open the GitHub project page of a repo from Terminal

Collapse
 
hoelzro profile image
Rob Hoelz

There's a feature in Git called insteadOf that allows you to make shorthand URLs (so you can say things like git clone me:my-project rather than git clone git@github.com:hoelzro/my-project) - git-config unfortunately doesn't handle insteadOf. If you want your function to work with these remote URLs, you can use git ls-remote --get-url origin instead.

You might also want to use the local bash builtin to introduce git_url and url as local variables to prevent your function from contaminating your bash session!