有没有办法改变Xcode的Git用户名和电子邮件?当我尝试提交时,它会发布我的真实姓名。我希望它发布我的GitHub用户名,以便您可以将提交链接到我在GitHub上的用户。更改Xcode中Git的用户名?
通常在Git中,我只能在终端输入git config --global user.name whoosh
,但它似乎无法在Mac和Xcode上工作。
有没有办法改变Xcode的Git用户名和电子邮件?当我尝试提交时,它会发布我的真实姓名。我希望它发布我的GitHub用户名,以便您可以将提交链接到我在GitHub上的用户。更改Xcode中Git的用户名?
通常在Git中,我只能在终端输入git config --global user.name whoosh
,但它似乎无法在Mac和Xcode上工作。
正如在 “Where is the Git commit info set in Xcode 4?” 所提到的,需要的XCode用户信息从名片从(2012年)Address Book(called Contact in 2014)。
修改您的联系卡会更改用户信息(新提交)
更新2014(2年后),如图sergtk的answer时,Xcode(5+)现在支持git config user.name
和user.email
。
以下终端命令对我的作品:
xcrun git config --global user.name 'new_user_name'
xcrun git config --global user.email '[email protected]'
这些分别以更新的用户名和电子邮件。
执行该命令后,通过Xcode连续提交到Git将使用其中指定的数据。
由于我有不同提交名称的多个项目,@sergtk提供的解决方案不适用于我。相反,我做了以下内容:
xcrun git config --local user.name 'new_user_name'
xcrun git config --local user.email '[email protected]'
另外请注意,第一次提交需要改变,所以我用这里提供的解决方案来解决这个问题:Change the author and committer name and e-mail of multiple commits in Git
我们应该在哪里打这些命令。请告诉我路径。 –
@RAIS - 与“.git”目录所在的路径相同。 – Greeso
我开始从企业MAC工作和有与bitbacket存储库相同的问题。任何答案都没有帮助我。 从地址簿中删除以前的用户并保存我自己的和终端命令。 有一天,我试图从SourceTree(从Atlassian免费软件)的新回购。我用喜好替换了用户名和邮件,一切正常。我已经承诺自己的凭据。耶! 我希望我的解决会有用!
有点半相关:是否GitHub不允许用户名/电子邮件别名比如BitBucket呢?无论如何你的问题+1,因为我不知道如何去做。 –
https://help.github.com/articles/setting-your-email-in-git /即使从Xcode推送到远程github repo,更改以下内容也会更改用户名。 –
我给这个链接的答案[找到简单的解决方案](http://stackoverflow.com/questions/41561391/why-all-my-xcode-commits-to-bitbucket-show-other-user-author-name-on -bitbucket/41561543#41561543) – Tejinder