I also observed this problem on Cygwin 1.7.9 on Windows 7. Somehow .git/FETCH_HEAD becomes corrupt. This happens with remotes that are retrieved via SSH, as well as on the same host.
For a workaround, consider an excerpt from the git pull documentation :
In default mode, git pull is short for git fetch , followed by git merge FETCH_HEAD .
To avoid reading FETCH_HEAD , explicitly indicate your branch. For example, assuming you are reusing master and tracking origin/master , run the following sequence to get the same effect as git pull .
$ git fetch
$ git merge origin / master
I thought this problem was sporadic, but I had problems in order to succeed lately.
#! /usr/bin/env perl use strict; use warnings; sub usage { <<EOUsage; Usage: $0 [how-many] where how-many is a positive integer (default: 100) EOUsage } $0 =~ s!^.*/!!; my $howmany = @ARGV ? shift : 100; die usage if @ARGV || $howmany !~ /^ (?!0+$) \d+$/x; my $bad; for (1 .. $howmany) { unlink ".git/FETCH_HEAD"; my $output = `git fetch -v 2>&1`; die "$0: git fetch exited ", ($? >> 8), ":\n", $output if $?; ++$bad unless system("git rev-parse -q --verify FETCH_HEAD") == 0; } my $pct = sprintf "%d%%", ($bad/$howmany) * 100; print "$0: fetches=$howmany, bad=$bad ($pct)\n";
source share