Skip to content

Instantly share code, notes, and snippets.

@pauldowman
Created June 13, 2012 17:13
Show Gist options
  • Save pauldowman/2925327 to your computer and use it in GitHub Desktop.
Save pauldowman/2925327 to your computer and use it in GitHub Desktop.
Script to open a browser with the github commit listing for the current repo & branch
#!/bin/bash
BRANCH=`git branch | grep '^\*' | awk '{print $2}'`
REPO=`git remote -v | grep origin | head -1 | sed 's/[^:]*:\([^\.]*\).*/\1/'`
open "https://github.com/$REPO/commits/$BRANCH"
@pauldowman
Copy link
Author

OS X only. Don't forget to make the script executable and put it in your path.

@rgould
Copy link

rgould commented Jun 13, 2012

What's DIR=pwd`` for?

@pauldowman
Copy link
Author

Oh, vestigial code from the previous life of this script. Gone now.

@rgould
Copy link

rgould commented Jun 13, 2012

That's what I thought, but I thought there was a chance it might be Bash voodoo :)

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