Search code examples
gitcygwinsamba

Existing GIT Repos over Samba don't work from Cygwin


I have a set of git repos on a Samba server which it seems I can no longer use from one of the Cygwin installations I've been using them from.

I have been using this same server for a few years without touching its OS at all. I did however update my Cygwin setup a few days ago.

$ git --version
git version 2.1.4

A little while ago I made an edit, committed it, and attempted to push. I got this output:

$ git push origin master
fatal: '//host/path/to/repo.git/' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I've been using said repo for over a year so it can't be anything in .git/config on either side.

I read Git over samba cannot fetch/add/commit anymore which seems to have concluded with a diagnosis that a kernel bug needed a patch (on the client side?). Since the client side is Cygwin, that would not apply to this case. Since the server side has not changed (still 2.6.27) a regression on that side is not a logical possibility.

There are a couple of other questions here which started with the same error messages through slightly different circumstances, and lead to the same conclusion, to patch the kernel as above.

My other Cygwin installation using the same set of repos is on git 1.7.9. It can still clone any of my repos, even a newly-created but empty one that was created by but cannot be pushed into by the Cygwin that has git version 2.1.4.


Solution

  • There is a bug in Cygwin 2.0.0 which is fixed in Cygwin 2.0.1-1. The bug is in cygwin1.dll. You can trace the diagnosis in this cygwin.com email thread and see the announcement

    Users who have encountered this problem on the affected Cygwin version should certainly try updating to the latest available version.

    The issue was with translating permissions between the different representations of permissions on the Samba share, Windows, and the Cygwin POSIX environment, as I understand it. For the correct information see the diagnosis thread mentioned above.

    My apologies for not reporting back promptly.