Github Windows 'Failed to sync this branch'

I am using Github Windows 1.0.38.1 and when I click the 'Sync' button after committing, I get the error

enter image description here

How do I debug this problem? If in the shell, what should I do?

The sync works fine if i do a git push or git pull, but the next time I want to sync using Github windows, I get the same error.


Solution 1:

When it says that, just open the shell and do git status. That will give you a decent idea of what could be wrong and the state of your repo.

I can't give you a specific error for this as it happens for many reasons in Github for Windows, like say some problem in updating submodules etc.

Solution 2:

This error comes because of a merge conflict in files. I faced it after I had updated my Maven Project's pom.xml but didn't commit it. Using

git status
error: Your local changes to the following files would be overwritten by merge:
<my project>/pom.xml
Please, commit your changes or stash them before you can merge.
Aborting

as the above post suggested helped finding any conflicting changes and you can decide to discard or commit.

Solution 3:

I had the same problem. It happened to me because of some conflicting changes. I removed the local repository of my project from my desktop and then cloned it again from the github website (using clone option in my account), the error was gone.

Solution 4:

I had the same problem when I tried from inside Visual Studio and "git status" in shell showed no problem. But I managed to push the local changes with "git push" via shell.