Mastering Git - Managing History

© 2012 - 2015 thoughtbot, inc. Upcase, the design of a robot, and thoughtbot are registered trademarks of thoughtbot, inc.

This is a companion discussion topic for the original entry at

@christoomey I always fast forward master by pushing directly to it :joy:

@christoomey calling the grep log command with git as defined in the show notes

  • $ git log --grep -E -i 'cach(e|ing)' throws an errror.

So, I resort to passing the flags after the string I am searching for like so

  • $ git log --grep 'cach(e|ing)' -E -i

However, I created an alias using a shell function on my .gitconfig like so:

  • glog = "!f() { git log --grep $1 -E -i; }; f"

Which you can use like so:

  • $ git glog 'cach(e|ing)'