Last active
March 29, 2017 21:15
-
-
Save othree/9503483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.link '!f() { echo https://$(git config --get remote.origin.url | sed s/^[[:alpha:]]*@// | sed s/:/\\// | sed s/\\.git$//)/commit/$(git rev-parse ${1:-HEAD}); }; f' | |
git config --global alias.linkc '!git link ${1:-HEAD} | pbcopy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
git link
to show git hub link for single commitOn OSX, you can pipe to pbcopy(system clipboard)
or (thanks @timdream)
Link is trustable only when commit were pushed.
Known issue
Remote 'origin' might not github.
License
MIT