125

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.

4
  • 1
    For me it was because I had forgotten to remove a very large file from the commit. Github has a max file size and I was over it.
    – Paul
    Commented Nov 28, 2014 at 9:05
  • 5
    I love the way there are so many answers, any of which could have been correct in this case, but none of them are. That's Git for ya. Commented Jan 3, 2015 at 20:16
  • 1
    This error can occur because you aren't connected to the Internet. Kind of obvious but...hey.
    – levininja
    Commented Apr 29, 2016 at 19:41
  • 1
    We were having internet issues in the office and this occurred. The git shell still worked though. Commented Sep 19, 2017 at 15:14

18 Answers 18

113

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.

5
  • 3
    Thanks! As a newbie when it comes to git and GitHub who had the same issue as the original question asker, this was very helpful :) Excellent answer! Commented Jan 18, 2014 at 22:09
  • 5
    git stash helped. Hope I will get on with GIT sometime.
    – ivkremer
    Commented Feb 7, 2014 at 21:25
  • I restarted my GitHub and it solved the issue! It happened after I had some conflicts to merge. Commented Jun 26, 2014 at 15:30
  • 1
    I have the same issue, however I am using a mapped drive. With this answer I now just commit with GitHub Desktop and git push through Git.
    – zanderwar
    Commented Jul 30, 2015 at 23:46
  • @manojlds what about when git status just says your branch is up to date, nothing to commit, working directory clean?
    – levininja
    Commented Apr 29, 2016 at 19:19
16

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.

1
  • I restarted my GitHub and it solved the issue! It happened after I had some conflicts to merge. Commented Jun 26, 2014 at 15:30
11

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.

0
5

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.

1
  • As rovsen says to add some colour to those stuck: If GitHub for Windows is crashing but in Git Shell you see all green and this git status message "Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits)". Entering git push fixed this for me. I restarted GitHub for Windows and sync finally worked!
    – micstr
    Commented Oct 16, 2017 at 9:37
4

I had this problem and found it was to do with the proxy. I fixed the problem using this command:

 git config --global http.proxy %HTTP_PROXY%
2

This is probably an edge case, but every time I've got this specific error it is because I've recently mapped a drive in Windows, and powershell cannot find it.

A computer restart (of all things) fixes the error for me, as powershell can now pick up the newly mapped drive. Just make sure you connect to the mapped drive BEFORE opening the github client.

2
  • Same here. Restarted and then it worked just fine shrugs Commented Jan 13, 2016 at 14:08
  • OMG! I just moved to a new office space and my mapped drives no longer worked. But they had nothing to do with git or my working folders. I simply removed the mappings and then GitHub Desktop started working. This has to be a bug since it should not even be looking at those mapped drives?
    – DeborahK
    Commented May 5, 2017 at 20:26
2

I had the same problem. In my case git could not find the global variable %HTTP_PROXY%, simply because Windows was not providing/using it.

I solved it by excluding the variable from the git config file (located in %USERPROFILE%\.gitconfig):

[http]
#   proxy = %HTTP_PROXY%
2

Have you changed your Windows password recently, or at least the one you use to connect to your proxy?

This was my problem, and git status couldn't help me. I had to change my login credentials in the ".git/config" file to get past this error.

1
  • I got the error from this. Seriously, they should just make this thing properly proxy aware in the UI and prompt for a new username and password. Or even NTLM if they're feeling (slightly) fancy.
    – Rob Grant
    Commented Jul 14, 2014 at 7:28
1

This error also occurs if the branch you're trying to sync has been deleted.

git status won't tell you that, but you'll get a "no such ref was fetched" message if you try git pull.

0
1

One more thing that can cause this is when you map a network drive or connect a VHD after GitHub Desktop has already been started. The reason for this is that GitHub Desktop uses ssh-agent from the portable GIT install to establish connections, and never closes it... even if you uninstall the application. The process starts with no knowledge of the new drive and never refreshes itself, and when it is used to run the GIT commands to work on your repo it fails because it doesn't understand the paths.

The solution in this instance is to close GitHub Desktop and use Task Manager to terminate the running ssh-agent before starting it again. This will start a new instance of ssh-agent when needed which will pick up the new drive mappings, etc.

1

Make sure that the branch you are trying to push to isn't protected. I was trying to push to a protected branch and failed same as you.

0

check "git status" and "git pull" in the shell and find out what's wrong. and my problem is http.proxy node in config, therefore Github Windows should much more smart like just pop the shell and give more tips after the error(s) emit.

0

Along the lines of the HTTP Proxy answers, this can also happen due to a VPN connection. Disconnecting my VPN connection solved it for me.

0

I had the same issue, and "git status" also showed no problem, then i just Restarted the holy GitHub client for windows and it worked like charm.

0

I had the same issue. I removed the repo from the GitHub Windows client (right-click menu) and re-added it. When I re-added, I noticed I had about 300 uncommitted changes and it was reporting a memory error. I discarded all the changes and then sync started working fine again. (Rookie Git user - I'm sure there are better ways to do this on the command line)

0

The debug log may provide some insight. I'm using v3.3.4.0, your experience may differ but should be similar. From the settings menu choose 'About Github Desktop...'. Click the link to view the debug log. In my case there was a very clear error:

*** fatal error - cygheap base mismatch detected - 0x1157408/0x1167408. This problem is probably due to using incompatible versions of the cygwin DLL.

It even provided some helpful tips to solve the problem.

I'm not sure why this information isn't exposed in the error prompt, but at least it was available.

0

I tried with Android Studio to commit Changes and push it to master But Window Showed a popup that I have to enter Github Credentials (https://github.com). I did Signup with my Gmail account So I tried to enter my Gmail id along with its password, Obviously Git do not have my Gmail password and can't match it with what I'm providing, So I ended up canceling the push.
When I tried to sync my changes through GitHub GUI Window I encounter this error. On git status command Git Shell suggested to push changes as

Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

I did the same as Git Shell suggested (git push) and everything is ok now.

Note: for someone who is new to git you have to change your path to the folder where your .git file is otherwise on Every Command you enter Git Shell will show error that its not a git repository.

fatal: Not a git repository (or any of the parent directories):

For example if your Project is in D drive in some folder you have to do something like below as you do in cmd to change directory.

cd D:\someFolder     // if your project is not deep in `D`

And if its within nested folder in D

cd D:\somefolder\someNestedFolder\nestedInNested     // if your project is not deep in `D`

If someone know how to login into Github popup from windows as I did signup with google account and here are 2 fields only Github username, password Please let me know. I have resolved the issue but with waste of some time so I want to know about login too.

0

I had same issue but with newer version of Github Desktop on Windows. This is what I did:

  1. I opened a Windows PowerShell from Settings in Github Desktop
  2. I wrote "git status"
  3. It said that my branch was ahead of origin/master by 1 commit
  4. I wrote "git push"
  5. The cause of the problem was here: it said that "Your push will publish a private email address"
  6. I followed the instructions I found here to change my address to noreply address: Meaning of the GitHub message: push declined due to email privacy restrictions

I could sync with Github Desktop from now on without problems

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.