Git failed with a fatal error. Authentication failed for

Working with Visual Studio 2017 Enterprise and git as source control.

I recently encountered an issue whilst trying to push local commits to a remote repository. The error message was:

Error encountered while pushing branch to the remote repository: Git failed with a fatal error. Authentication failed for...

The solution is as follows:

  1. Open Control Panel in Windows
  2. Click on User Accounts
  3. Click on Manage your Credentials
  4. Click on Windows Credentials
  5. In the list titled Generic Credentials, locate the entry for your remote git repository
  6. Click the item in the list and then Edit
  7. Set the Username and Password to the correct credentials

This should now allow you to successfully authenticate with the remote repository