(disclaimer: this is my link/blog/software)
If that doesn't work for you, this might:
history 1 | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
What that doesn't give you is the command tree, for example "git commit" vs "git checkout". It just does "git".
[edit, added gem link] The gem is here https://github.com/paulmars/huffshell