You're going to be asked this multiple times I suppose, might as well have some place to point them, but have you tried using [Emscripten](https://github.com/kripken/emscripten/blob/master/README.markdown) with libgit?