Xcode 7 GM can't commit (GIT)

隐身守侯 提交于 2019-12-18 04:31:58

问题


Whenever I try to commit, using source control in Xcode, I get an error that I need to configure my email address and name (it seems to read my email address incorrectly). I went to the Terminal, and entered them (again). The error didn't go away.

I can commit normally in Terminal, but not in Xcode. Is there a way to fix it? Or enter the configuration info directly in Xcode?

This is the error message:

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'myemail@gmail-1040826.(none)')

Here's my .gitconfig (I replaced my actual name with "My Name", and my username with "myname" for privacy reasons):

myname-1040826:Project myname$ git config -l
user.email=myname@gmail.com
user.name=My Name
filter.media.clean=git-media-clean %f
filter.media.smudge=git-media-smudge %f
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
submodule.PeerKit.url=https://github.com/jpsim/PeerKit.git

回答1:


It looks like Xcode is not reading global GIT settings. If you encounter this issue, set your name and email to the specific project via the Terminal:

git config user.email "you@example.com" 
git config user.name "Your Name"

Note: Make sure you are in the project's directory when you do the above.




回答2:


It's not only the matter in global settings, the real problem are local ones.

Try this.

cd your/project/directory
git config --local user.email "your@email.com"
git config --local user.name "yourName"

This worked for me.



来源:https://stackoverflow.com/questions/32544188/xcode-7-gm-cant-commit-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!