Github "Failed to publish this branch" error on windows Github "Failed to publish this branch" error on windows windows windows

Github "Failed to publish this branch" error on windows


In Windows, right click on your repository --> click on open a shell here

You will see a command prompt.

type git push in it. (been aware after seeing SimonBoudrias comment)

The command prompt will suggest you to type some other command or shows an error.

If the command prompt suggest you to type something else, then type that. It will work.
If the command prompt shows error then please post the detailed error here.

Info: You might want to check this app


Open a shell in your repository. Then type

git push --set-upstream origin master --force

This will upload your local repo to the server no matter what, overwriting if necessary. This should only be done if you're sure nobody else is publishing to your repo at the moment.


I had the same issue as mentioned here, but none of the solutions mentioned above helped. Then I found this answer which talks about Proxy settings, which is exactly why GitHub was failing to commit on my machine. Hope this helps somebody else

To set up your Proxy Settings, you just need to use this command:

git config --global http.proxy http[s]://userName:password@proxyaddress:port