如何在Xcode中更改Git的用户名? [英] How to change the username for Git in Xcode?

查看:107
本文介绍了如何在Xcode中更改Git的用户名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改Xcode的Git用户名和电子邮件?当我现在尝试提交时,它将发布我的真实姓名.我希望它发布我的GitHub用户名,以便您可以将提交链接到我在GitHub上的用户.

通常,使用Git,我已经能够在终端中键入 git config --global user.name whoosh ,但是它似乎在Mac和Xcode上不起作用.

解决方案

如"

之前使用 xcrun git config 命令允许从命令行定位或调用支持共存和平台的开发人员工具.
(假设 Xcode命令行工具是最新的)

Is there any way to change the Git username and email for Xcode? When I try commit now it will post my real name. I want it to post my GitHub username so that you can link commits to my user on GitHub.

Usually with Git I've been able to just type git config --global user.name whoosh in the terminal but it doesn't seem to work on Mac and Xcode.

解决方案

As mentioned in "Where is the Git commit info set in Xcode 4?", XCode takes user information from your contact card from your (2012) Address Book (called Contact in 2014).

Changing your contact card would change user information (for new commits)


Update 2014 (2 years later), as illustrated in sergtk's answer, XCode (5+) now supports the git config user.name and user.email.
That will fill out:

Using xcrun before the git config commands allows to locate or invoke coexistence- and platform-aware developer tools from the command-line.
(assuming the Xcode Command-line Tools is up-to-date)

这篇关于如何在Xcode中更改Git的用户名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆