I was getting this also. at first I could restart the mac and everything was working fine. Eventually though the problem came back with a vengeance even with a restart it would not let me commit so I had to do the command line loving. one caveat being that you have to type xcrun before any git commands in terminal when using vanilla git installed with Xcode.
so type:
xcrun git config --global user.email your@email.com
xcrun git config --global user.name "your name"
after doing this everything was fine and dandy.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…