1

I upgraded to Xcode 7.0 yesterday and now git commit (Command-option 'c' in Xcode) gives this diagnostic:

enter image description here

The local repository already exists and has many commits in it. This is a project I've been working on for an embarrassingly long time.

I did the git commands the diagnostic says but it still gives the same diagnostic. I did git config --global user.name and it returns my real and correct name, and git config --global user.email returns my real and correct email. I did these commands in the directory that contains the .git directory, and also in my home directory because I don't know whether the directory matters. I get the same (correct) response in both. I also did git config -l and everything listed looks correct and nowhere do I see the bad email address quoted in the diagnostic.

Commit in a different project gives the same diagnostic.

Maybe if I knew where that erroneous email address came from I would understand what's going on. Can somebody who understands Xcode git please say what's wrong and how to fix it?

RobertL
  • 14,214
  • 11
  • 38
  • 44
  • Possible duplicate of [Xcode 7 GM can't commit (GIT)](http://stackoverflow.com/questions/32544188/xcode-7-gm-cant-commit-git) – Jeff Oct 10 '15 at 14:50

1 Answers1

3

Despite the error message, the problem is not the global .gitconfig. It's the .gitconfig inside the project repo.

Use git config --local to set its user.name and user.email. Or just copy them from the global .gitconfig and paste them into the local .gitconfig.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • You're right - many thanks! Before setting those parameters I did git config --local -l and saw that the user.name and .email are not there. I still don't know where the wrong email in the diagnostic came from. I guess the way to say the cause of the problem is that Xcode 7.0 looks ONLY at the local .gitconfig even if the user.email and/or user.name is missing. Sounds like a mistake, not a feature. Xcode 6 must have looked at the global config if those parameters were missing from the local file. – RobertL Sep 19 '15 at 19:04