Skip to content

Instantly share code, notes, and snippets.

@rtlechow
rtlechow / github-commits-listing
Created June 13, 2012 18:06 — forked from pauldowman/github-commits-listing
With file and line number!
#!/bin/bash
BRANCH=`git branch | grep '^\*' | awk '{print $2}'`
DIR=`pwd`
REPO=`git remote -v | grep origin | head -1 | sed 's/[^:]*:\([^\.]*\).*/\1/'`
top_level=`git rev-parse --show-toplevel`
full_path=$PWD/$1
relative_path=${full_path#*$top_level/}
line=$2