Xcode 4 中设置的 Git 提交信息在哪里?
请注意,这不是我面临的问题,我对这里发生的事情更感兴趣,因为这对我来说没有(多大)意义。
下面显示的信息在哪里设置?
根据 Daniel 的说法,当他运行 git log
时,提交者显示为 [email protected]
,这是他在 Mac 上的用户名,后跟他的 Mac 网络主机名,因此它不会从 Gravatar 或类似服务获取名称和图标。
所显示的照片是他在 Mac 上的用户照片。
用户是否可以/在哪里可以设置提交者信息?
如果可以设置,应该在 global/project .gitconfig
文件中设置,还是在其他地方设置?
Note that this isn't a problem I face, I'm more interested in what is going on here, because this just doesn't make (much) sense to me.
Where is the info shown below set?
According to Daniel, when he runs a git log
, the committer is shown as [email protected]
, which is his username on his Mac followed by his Mac's network hostname, so it isn't getting the Name and Icon from Gravatar or a similar service.
The photo shown is his user photo on his Mac.
Is it possible/where can a user set the committer info?
If it is possible to be set, should it be set in the global/project .gitconfig
file, or somewhere else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,我认为答案一直在盯着你......我相当确定所有这些信息实际上都来自我的名片,并且由 Xcode 独立于版本控制系统存储和使用。事实上,我在之前的一条推文中(你回复了)提到我用了我的联系卡。我可能应该指出,最初使用的提交作者姓名是我的本地用户名,并且没有照片。
单击照片会显示一个弹出窗口,其中有许多我可以填写的有关我自己的字段,例如名字、姓氏和一些联系信息。有一个选择卡...按钮,我用它来附加我的卡。
所以看起来确实就像 Xcode 将我的联系人卡片附加到我的提交信息中,但事实证明 Xcode 将其用于自己的显示目的,而不是将其与我的 Git 作者信息绑定。另外,正如评论中提到的,我在任何 Git 配置文件中都找不到该信息,而且我还没有使用 GitHub(提示推荐、链接和关于其出色之处的推荐)。
哦,我刚刚检查过...更改我的联系人卡片中的字段之一会导致更改反映在 Xcode 中,反之亦然。
Actually, I think the answer was staring right at you all along... I'm fairly certain that all this info really is coming from my contact card, and is stored and used by Xcode independently of the version control system. In fact, I mentioned in an earlier tweet (which you replied to) that I'd used my contact card. I probably should have pointed out that, initially, the commit author name in use was my local username and there was no photo.
Clicking on the photo reveals a popover with a number of fields I can fill in about myself, like first name, last name, and some contact information. There's a Choose Card... button, which I used to attach my card.
So it does seem like Xcode attaches my contact card to my commit info, but it turns out that Xcode uses it for its own display purposes rather than tying it to my Git author info. Plus, as mentioned in the comments, I can't find the info in any of my Git config files, and furthermore I don't use GitHub yet (cue recommendations, links and testimonials as to its awesomeness).
Oh and I just checked... changing one of the fields in my contact card causes the change to be reflected in Xcode, and vice versa.
请参阅设置您的用户名、电子邮件和GitHub 支持网站上的 GitHub 令牌 页面:
也许您可以确保这些密钥不是在您的 项目
.git/config
文件中设置的,而是在你的全局.gitconfig
文件。See the Set your user name, email and GitHub token page on the GitHub support site:
Maybe you could make sure these keys are set not in your project
.git/config
file but in your global.gitconfig
file.