Extract git mixin into its own module

Fixes #1208