Last active
May 18, 2016 02:02
-
-
Save commanda/4238046 to your computer and use it in GitHub Desktop.
A bash script that opens the github.com commits page for the project you're sitting in (nicer than looking at git log)
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
#!/bin/bash | |
URL=`git config remote.origin.url` | |
# if its a git@, replace that with https:// | |
URL=`echo $URL | sed -e "s/git@/https:\/\//g"`; | |
URL=`echo $URL | sed -e "s/com:/com\//g"`; | |
# remove the .git at the end | |
URL=`echo $URL | sed -e "s/.git$//g"`; | |
# append /commits/ to go to the commits page | |
URL=$URL/commits/; | |
open $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
git config remote.origin.url
from anywhere within the source tree, I believe.