Skip to content

Instantly share code, notes, and snippets.

@commanda
Last active May 18, 2016 02:02
Show Gist options
  • Save commanda/4238046 to your computer and use it in GitHub Desktop.
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)
#!/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
@dustin
Copy link

dustin commented Dec 8, 2012

You can use git config remote.origin.url from anywhere within the source tree, I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment