Visual Studio - Azure Dev : failed to push the branch to the remote repository

Viewed 3168

I'm using VS2019 and Azure DevOps. I'm no expert at all on source control and i've only been using Azure Devops as a backup of my projects.

I recently had to have my computer reinstalled and started a new project. But when trying to push to Azure DevOps i'm getting the following error:

Failed to push the branch to the remote repository. See the Output window for more details.

Pushing master

Error encountered while pushing branch to the remote repository: Git failed with a fatal error. unable to update url base from redirection: asked for: https://dev.azure.com/...../info/refs?service=git-receive-pack redirect: https://spsprodweu4.vssps.visualstudio.com/_signin?

It seems i'm being redirected to the signin page. But i'm signed in in Visual Studio and i'm seeing other projects. How can i solve this?

1 Answers

It seems that your local credentials are mixed after reinstalled the computer, please clear the stored TFS credentials in Visual Studio 2017 and Git credentials by following below steps.

  • Close all Visual Studio instances, delete %LOCALAPPDATA%\.IdentityService.
  • Clear TFS caches %LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache
  • Clear all the browser caches especially for the stored password
  • Look in the Windows Credential manager and remove the TFS related credentials and Git credentials there enter image description here
  • Restart Visual Studio > Team Explorer > Manage Connections to check if the Enter credential dialog popup. Just try this several times or restart VS to popup it again.
  • Enter the user password, then Team Explorer > Manage Connections to connect to target project. See this thread for more details.

In addition, you could follow this doc: Connect from Visual Studio or Team Explorer to get more guidance.

Update If your access level is Stakeholder in this organization, you cannot contribute to Azure Repositories. And members of Project Collection Administrators group can change access level.

Related