John
John

Reputation: 2694

Xcode 7 Git Setup Fail: unable to auto-detect email address

When enabling Git Repository Source Control for a new project on Xcode 7, it shows:

enter image description here

However, even after I setup user.name and user.email in terminal:

git config --global  user.name "John"
git config --global  user.email "[email protected]"

I checked and see from Terminal using

 git config --global -l

The result shows: enter image description here

I also checked local config in the project folder using:

 git config --local -l

user.name and user.email were not set locally.

But I still cannot commit and the same message from Xcode pop up. Any ideas what's going wrong? Please help!

Upvotes: 3

Views: 1093

Answers (2)

John
John

Reputation: 2694

Found the solution:

  1. Go to project folder, look for ./git directory
  2. Open the file "config" with TextEditor.
  3. Terminal git config command seems not applied to this config file correctly.It was like this: enter image description here
  4. I changed it to enter image description here and saved.
  5. Commit and everything works!

Side Note: about how to find the hidden .git in project directory. Xcode 5 - remove source control for project Show hidden file in Mac

Upvotes: 2

Vamsi Ravi
Vamsi Ravi

Reputation: 1236

In the terminal

$ git config --global user.name "Your Name"
$ git config --global user.name
Your Name

$ git config --global user.email "Your email ID"
$ git config --global user.email
Your email ID

In the local(for a particular repository) In the terminal goto the working directory

$ git config user.name "Your Name"
$ git config user.name
Your Name

$ git config user.email "Your Email ID"
$ git config user.email
Your Email ID

Upvotes: 0

Related Questions