Skip to content

Instantly share code, notes, and snippets.

@n8gray
Last active October 26, 2017 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8gray/3582d6ae464e06203eebc1a7659f3313 to your computer and use it in GitHub Desktop.
Save n8gray/3582d6ae464e06203eebc1a7659f3313 to your computer and use it in GitHub Desktop.
Git: Show the details of a commit and all its parents
#!/bin/zsh
#
# Shows the raw details of a commit and all its parents
#
if [[ $# < 1 ]]; then
SHA=HEAD
else
SHA=$1
fi
for HASH in `git rev-list --parents -n 1 $SHA`; do
git log -n 1 --format=raw $HASH | cat
echo
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment