0

I have created a one branch. When I created one Pull Request, then it is showing the details correctly in VSTS. For Example, User1 created a Pull Request and commit author also showing as User1. But , When I made some changes in the above branch and pushed the changes, then it is showing different username.

For Example, User2 pushed 2 commits creating - update 2

Here, actually wrong user name is displaying.

Initially, repository is connected using User2 credentials and later user1 credential is used in all the places (Git, VSTS, Visual Studio Account). When some update is made and pushed, then User2 name is displaying instead of User1

I have tried below options nothing workedout.

 - Uninstalled the Git and Reinstalled it again
 - Restarted the System
 - Deleted the Generic Credentials from the credential manager (
   Credential manager --> Windows Credential --> Generic Credentials -->
   Removed my project Repository)

When I try to connect my repository in Team Explorer, credential popup is not getting opened and it looks , it is taking the old username .

How do I solve my problem?

Subburaj
  • 2,294
  • 3
  • 20
  • 37

2 Answers2

2

Firstly make sure you are using the same account to create the Pull Request and push the changes.

Generally we can only create a Pull Request form web portal, while you may push the commits from Visual Studio with Team Explorer. So, is it possible that you are not using the same account in web portal and Team Explorer?

Based on my test, even if we changed the Git global settings (Change the User Name and Email Address), the changes only reflect on the commit Author. The push message will still show the user which connected to VSTS repository... Reference below screenshot.

Well, if you confirmed that you were using the same user account... Then you can try below things to narrow down the issue:

  • Sign out by the steps below:
    1. Click on your profile in the up-right corner of VS.
    2. Click "Account Settings".
    3. Remove the credential that you have already signed in.
    4. And you can also clear the .IdentityService folder under %localappdata%. VS2017 stores VSTS Account credential there.
    5. Sign in again with your account.
  • Clean caches, reference this thread: Clear stored TFS credentials in Visual Studio 2017
  • Change your account password, reconnect to VSTS, check if the credential dialog can pop up.

  • This thread may also helps : Remove credentials from Git

enter image description here

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • I have done all the above steps along with uninstalling the visual studio. Now the correct username is displaying – Subburaj Sep 14 '18 at 11:56
0

In my case, I added User1's SSH public key to User2's VSTS account. So, User1's pushes were showing User2's name though commits were showing User1's name. I resolved it by adding User1's public key to User1's account.

Asif Ali
  • 61
  • 4