Not a pre-commit hook, but a post-update or post-receive hook and then put *.pb.go in .gitignore. Not sure if either of those hooks would work. Why is git so freaking obscure? This was fairly straightforward to do with mercurial. Just leave as-is for now.