Skip to content

Instantly share code, notes, and snippets.

@dindinw
Created September 28, 2012 07:57
Show Gist options
  • Save dindinw/3798534 to your computer and use it in GitHub Desktop.
Save dindinw/3798534 to your computer and use it in GitHub Desktop.
cat all git objects under .git/objects folder
# git_cat : cat all git objects
# find .git/objects/ -type f|cut -c14-15,17-20|xargs -I {} sh -c "echo '\nFor {}:' ; git cat-file -p {}"
function git_cat (){
for o in $(find .git/objects/ -type f|cut -c14-15,17-20); do
echo $(tput bold) $o \($(tput setaf 1) $(git cat-file -t $o)$(tput sgr0)$(tput bold) \):$(tput sgr0)
git cat-file -p $o
done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment