Skip to content

Instantly share code, notes, and snippets.

@jleedev
Created April 27, 2011 23:29
Show Gist options
  • Select an option

  • Save jleedev/945467 to your computer and use it in GitHub Desktop.

Select an option

Save jleedev/945467 to your computer and use it in GitHub Desktop.
#!/bin/sh
export PAGER=
[ $# -le 1 ] || (echo "Usage: git how [ref]"; exit -1)
[ "$1" ] && ref="$1" || ref=HEAD
old="$ref@{1}"
git rev-parse --short "$old" | tr -d '\n'
printf ..
git rev-parse --short "$ref"
git diff --stat --summary "$old" "$ref"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment