Please see my response in New Interface Proprosal: The `git` interface. It seems between the ssh-keys interface and the ability only to add github information to the snap-specific gitconfig, this is sufficient for the snap to work in strict mode.
We are getting a lot of requests for ~/.gitconfig. I suspect use of the import path idea for this would be the way to go (which, incidentally, would be a great starting PR for someone interested in snapd development).