I'm looking for a bash script to generate a GitHub link to a file from the filename in my local checkout.
So if this script existed and was named github-link-for-file
, it might work like this:
$ git clone [email protected]:torvalds/linux.git
$ cd linux
$ github-link-for-file include/math-emu/quad.h
https://github.com/torvalds/linux/blob/master/include/math-emu/quad.h
I expect that such a script already exists, but I can't find it. Can anyone else?
(If not, maybe I should write it and add it to a project like https://hub.github.com/. It looks like their "git browse
" command is very nearly what I want.)