Prints the URL of a file in a git repository from command line, so it is easier to share links to files in git repositores.
$ git url <path_to_file> [remote]
$ git clone [email protected]:maorfr/git-url.git && cd git-url
Cloning into 'git-url'...
$ git url README.md
https://github.com/maorfr/git-url/blob/master/README.md
- Clone this repository.
- Copy
git-url
to your $PATH. - Add git alias -
git config --global alias.url '!git-url'
.