Search code examples
gitvisual-studio-2019

Visual studio 2019 "Error encountered while pushing to the remote repository: Failed to push to the remote repository..."


In Visual Studio 2019 I have "Unpushed Commits" as seen below:

enter image description here

When I try to push them I get the error and this is what it looks like on the GUI: enter image description here

note: the yellow label with "Failed to push..." is not clickable.

The Output from Source Control - Git is as follows: enter image description here

The output window doesn't show me any useful details. Am I looking in the wrong place? Is there a better place to see the actual error?

The answer in this case is that the policy on the branch 'develop' does not allow direct pushes. I was kinda hoping that the error in the output would state something like 'Failed to push due to a policy constraint on the branch'


Solution

  • Have few reasons for this case:

    1. Try pull, then push.
    2. Check permission (you maybe haven't permission to push, after a change). You maybe push to just protected branch.