If you are exhausting all options above and you are using redhat OS and still not able to get it resolved. Check if fapolicyd is enabled. If fapolicyd is enabled you get all sort of Operation Not Permitted when performing git commands. If that is the case, it is fapolicyd that messes up your files. Add an allow rule to your /etc/fapolicy.d/rules.d/70-trusted-lang.rules (or other file). Example: allow perm=any exe=/usr/bin/git all : all
remember to regenerate the rule and reload the service.