After version 2.35, git will fail when doing git operation if user is not the owner of git repository due to a patch for a CVE issue.
A quick fix(Well, I think it is just a temporarily method.) for users with home is setting git config.
git config --global --add safe.directory {git repo path}
However, this method cannot apply to a homeless user. Git config need to lay in user's home directory.
How to let homeless user operate unsafe repository (setting some environment variable)?