https://help.github.com/articles/ignoring-files
If you skip all the generated binaries and the dlls and heavy things in the repository then it shouldn't have a problem with optimization.
Here is how you disable it:
https://www.kernel.org/pub/software/scm/git/docs/git-gc.html
git config --global gc.auto 0
Hope that helps.