Git gc using excessive memory, unable to complete
Some other config options that you might want to try restricting to lower than default values include:
pack.packSizeLimit
core.packedGitWindowSize
core.packedGitLimit
... all of which are documented in the git config
documentation. It's particularly worth checking in each case what units are understood, which I've made mistakes with in the past.