I need to be able to clone and checkout git repos for an electron (node.js) app I'm working on. The app is to be expected to run on Windows and popular Linux distros without requiring any external dependencies being preinstalled. This means I can't assume git will be installed and available on the command line.
I've tried these repos but ran into issues with each:
isomorphic-git - Seems to eat through memory like crazy when cloning and then crashes due to a lack of memory when trying to process a 1.8GB packfile.
nodegit - Either fails during app compilation or fails on app startup with errors seemingly all related to recent versions of electron/node. Can see many other people with same and similar problem in the GH issues but seems to be unresolved. Have tried multiple different versions with no luck.
wasm-git - Strange and awkward interface, can clone but it doesn't seem to come with a .git folder and can't figure out how to get checkout to work. Lack of docs and seems to have its own problems working inside electron.
simple-git - Seems like a nice, well written lib, but requires git either be preinstalled on the system or pointed to a custom git binary that it can interface with.
Bundling a portable git.exe with my app that I can either use directly or use with simple-git seems like the only option I have left, but I don't know how to get my hands on a small git.exe. The "portable" git for windows is 280MB after extraction, which is way too big for me to bundle.
Can anyone help me with building a statically linked version of git for Windows & Linux that isn't absolutely huge in file size? I know next to nothing about C or compiling C programs into binaries, let alone completely portable ones. Have tried flailing around trying to work out how to do it for hours but am getting nowhere fast.
Any other ideas for how I can clone & checkout a git repo within my app welcomed.