Skip to content

Instantly share code, notes, and snippets.

@chrisdarroch
Last active December 20, 2016 16:29
Show Gist options
  • Save chrisdarroch/07d0e61d9cd68e5f2b9b5126a6c233bd to your computer and use it in GitHub Desktop.
Save chrisdarroch/07d0e61d9cd68e5f2b9b5126a6c233bd to your computer and use it in GitHub Desktop.
A shell function that shows you the difference a Git branch made at the point it branched from your current one
function gdist {
basename="$1"
basesha="git merge-base HEAD $basename"
git diff "$basesha" "$basename"
}
gdist () {
basename="$1"
basesha="`git merge-base HEAD $basename`"
git diff -M "$basesha" "$basename"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment