Github 上正确的 VCS 用户名设置是什么,以便“我的更改”显示工作正常吗?

发布于 2025-01-06 01:28:45 字数 448 浏览 0 评论 0原文

我为个人 GitHub 项目 设置了 TeamCity 持续构建流程,效果良好。但是,在 TeamCity 中,我想在“我的更改”(http://teamcity/changes.html) 下查看提交列表。

在“VCS 用户名设置”(http://teamcity/vcsSettings.html) 下,我已将用户名设置为“benpowell”以匹配我的 Github 帐户,如您所见 所有提交 都记录在该名称下。但是,没有任何提交记录在“我的更改”下。

有什么想法吗?

I have a TeamCity continuous build process setup for a personal GitHub project which works well. However, in TeamCity I want to see a list of commits under "My Changes" (http://teamcity/changes.html).

Under "VCS Username Settings" (http://teamcity/vcsSettings.html) I have set the username as "benpowell" to match my Github account and as you can see all commits are logged under that name. However, none of the commits are logged under "My Changes".

Any ideas why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

相守太难 2025-01-13 01:28:45

可能有帮助的一点是,TeamCity 在 VCS 根目录下有一个“用户名样式”设置。对于新安装的 TeamCity 9.0.1,它默认为“Userid”。我必须进去并将其更改为“作者电子邮件”。 注意 - 此设置隐藏在“高级选项”下。

根据屏幕显示,它只会影响从源新收集的更改。

完成此操作后,您应该能够成功使用 VCS 用户名下的电子邮件地址。

有关此设置的更多详细信息,请参阅屏幕截图:

在此处输入图像描述

One note that might help is that TeamCity has a "Username style" setting under the VCS root itself. For a new installation of TeamCity 9.0.1, it defaulted to just "Userid". I had to go in and change it to "Author Email". Note - this setting is hidden under "advanced options".

Per the screen, it will only affect newly collected changes from source.

Once this is done, you should be able to use email addresses under VCS Username successfully.

See the screenshot for more details on this setting:

enter image description here

愛放△進行李 2025-01-13 01:28:45

要找到正确的 VCS 用户名,请打开 TeamCity 并查看您的构建。在最近历史记录下,您将看到一个名为更改的列,它链接到触发构建的提交/推送(如果您有持续集成设置)。

用户名显示在 screenshot 中,如下所示:

值得注意的是,该用户名似乎链接到我的电子邮件地址。这是我的 Gmail 地址的用户名部分。我假设 Github 提取了该用户名,因为我个人不会选择该用户名。

To find the correct VCS username open up TeamCity and view your build. Under Recent History you'll see a column that is called Changes, which links to the commit/push that triggered the build (if you have continuous integration setup).

The username is shown there as seen below in the screenshot:

Notably, the username does appear to be linked to my email address. It is the username part of my Gmail address. I'm assuming Github extracted that, because I wouldn't have chosen that username personally.

夜深人未静 2025-01-13 01:28:45

我遇到了类似的问题,发现这篇文章很有帮助。三件事决定了您对 git 的提交和 TeamCity 中的构建信息之间的用户绑定:

  1. 在本地克隆中设置正确的 git 身份(即 git config user.name ,以及user.email)。这就是 git 标记你的提交的方式。
  2. 在您的 git 身份和 TeamCity 身份之间建立映射。这是通过在 VCS 根的高级设置中设置用户名样式来完成的。
  3. 在 TeamCity 用户配置文件中的版本控制用户名设置中设置默认用户名。这是您在 #2 中指定的映射将用作查找键的值。

例如,假设用户的本地克隆 git 身份为 user.name JCoderuser.email [电子邮件受保护](上面#1),以及UserId用户名样式(#2)上面,以及一个具有名称 Joseph Coder版本控制用户名的 TeamCity 帐户上面 joe.coder (#3) 的设置。

TeamCity 会正确将此用户的更改(例如,在构建历史记录中)归因于 TeamCity 用户 Joseph Coder。这是因为 UserIdUserName Style 通过使用 user.emailjoe 的电子邮件前缀在 git 和 TeamCity 用户之间进行映射。在本例中是编码器。请注意,有多种用户名样式(映射样式)。我坚持使用 UserId 因为它使用电子邮件地址,这通常是最稳定的标识符。

I had a similar problem and found this post helpful. There are three things that determine the user bindings between your commits to git and build information in TeamCity:

  1. Setting the correct git identity in your local clone (i.e. git config user.name, and also user.email). This is how git stamps your commits.
  2. Establishing the mapping between your git identity and your TeamCity identity. This is done by setting the UserName Style in the advanced settings of your VCS roots.
  3. Setting the default username in the Version Control Username Settings in your TeamCity user profile. This is the value that will be used as the lookup key by the mapping you specified in #2.

So, for example, assume a user has a local clone git identity of user.name JCoder and user.email [email protected] (#1 above), and UserName Style of UserId (#2) above, and a TeamCity account with the Name Joseph Coder and Version Control Username Setting of joe.coder (#3) above.

TeamCity will correctly attribute this user's changes (in build history, for example) to the TeamCity user Joseph Coder. This is because the UserName Style of UserId maps between git and TeamCity users by using the email prefix of user.email, joe.coder in this case. Note that there are several Username Styles (mapping styles). I stick with UserId because it uses the email address which is typically the most stable identifier.

皇甫轩 2025-01-13 01:28:45

使用 GitHub,您需要将提交中使用的电子邮件地址添加到您的 GitHub 帐户,以便将它们视为您的提交。

With GitHub you need to add the email address used in the commits to your GitHub account for it to see them as your commits.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文