问题
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?
回答1:
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:

回答2:
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

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.
回答3:
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:
- Setting the correct git identity in your local clone (i.e.
git config user.name
, and alsouser.email
). This is how git stamps your commits. - 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.
- 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 joe.coder@foo.com
(#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.
回答4:
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.
来源:https://stackoverflow.com/questions/9295649/what-is-the-correct-vcs-username-settings-with-github-so-that-my-changes-works