the new git is causing headaches for me too. It delivers errors based on the ownership of directories above it, to address this:
https://github.blog/2022-04-12-git-security-vulnerability-announced/ which means that any kind of git work in the macports trees (owned by macports) even as root now causes errors unless folder by folder exceptions are made. Yuk. I rolled back to the last git before this fix for the time being. Ken