To apply the fix from StackOverflow post, you can either edit [repository.root]/user/repo.git/config for just the one large repo or edit /var/lib/gitea/.gitconfig for all repositories and add:
[pack]
windowMemory = 100m
SizeLimit = 100m
threads = 1
Alternatively, add window = 0 instead of windowMemory, SizeLimit, … to disable packing entirely, but note that cloning will be less efficient.