Bitbucket Server のコミットで、コードをプッシュしたユーザーとは別のユーザー名が表示される

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

Frequently, new Bitbucket Server users believe that the user that pushes changes to Bitbucket Server should be listed in the Author column of the commits displayed in the UI. Take, for example, the following screenshot:

While the Author column displays "Integration Builder," the user who performed the commit, the user who pushed the code to the repository was a different user, "Test1".

環境

Bitbucket Server および Data Center (バージョン 2.12+)

診断

  1. First, check your git configuration to see if the email address set on your git config file matches the email address specified on your Bitbucket user profile.

    $ git config -l
  2. If the email address set on your git configuration file seems to match the email address specified on your profile, run the following SQL command on the database of the Bitbucket Server instance:

    $ SELECT * from cwd_user WHERE lower_email_address LIKE '%your_email_address%';

    (warning)Suppose the SQL command comes up with more than one result. In that case, this shows that your email address is, for some reason, associated with multiple accounts on your Bitbucket instance – possibly caused by having two users in different user directories on the Bitbucket Server.
    (warning)If the SQL command comes up with zero results while the user with this email exists in Bitbucket, this shows that the user's email address may have spaces or other non-printable symbols.

原因

The user displayed in the "Author" column is the user that committed changes to the local repo, which occurs before the data is pushed to Bitbucket server. The configuration happens on the local Git client.

The Bitbucket Server user who pushed the changes is not displayed anywhere in the UI in Bitbucket older than 6.9. In Bitbucket 6.9 and newer, you can see the Avatars of both the committer and user who pushed under the Author column, as shown below.


In the case of spaces in the email, the issue mostly comes from LDAP.

ソリューション

Case 1: The email address set in the git config does not match the email address on your Bitbucket server:

Suppose your email address specified on your git configuration file does not match the email address specified on your Bitbucket Server user profile. In that case, this is expected behavior, and you need to configure your local Git client accordingly. If you want to see a different user on that column, you must update your Git configuration and perform a new commit:

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com


詳細については
アトラシアンの Git のマイクロサイトをご確認ください。

Case 2: Email address in git config matches with an email address on Bitbucket:

If the email address set on your git configuration file matches the email address specified on your Bitbucket Server user profile, the SQL command mentioned in the 'Diagnosis' step returns more than one result. In this case, multiple user accounts share the same email address. Bitbucket Server will pick the first user returned with this email address based on alphabetically sorting the usernames that belong to that email address. The solution is to change the email address associated with the other user accounts.

  • From the SQL command output, note the username(s) associated with your email address.
  • Change the email address of the Bitbucket user(s) associated with your email address (either from Bitbucket Server or your external user directory) – leave out the one user you want associated with your email address.

Bear in mind that as of Bitbucket Server 2.12, we have been supporting "username linking" - when you're logged in to Bitbucket Server, you'll notice that wherever commit author names are displayed (for example, on the commits list and the blame view) they are now linked to the profile page of the author (if the author is also a Bitbucket Server user). Authors are matched to Bitbucket Server users via the author's email address, and the user's name in their Bitbucket Server account is displayed instead of their git author name.

参考:

If the resolution does not work, please get in touch with Atlassian Support.

説明 This article discusses an issue where a commit in Bitbucket server shows a different username than the one that pushes the code.

最終更新日 2023 年 11 月 28 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.