开发者

Does git on cygwin support repositories on Windows network shares?

开发者 https://www.devze.com 2023-02-14 20:57 出处:网络
I tried to set up a bare git repo for backup, as proposed in nes1983\'s reply to this question. I am using git on cygwin. My local repository is on /cygdrive/C/my-project. When I set up my backup rep

I tried to set up a bare git repo for backup, as proposed in nes1983's reply to this question.

I am using git on cygwin. My local repository is on /cygdrive/C/my-project. When I set up my backup repository on the same disk, everything works fine.

However, if I set up the bare repo on a network drive /cygdrive/H/backup-repo, I get the following error:

bash-4.1$ git push backup
Counting objects: 101, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (85/85), done.
Writing objects: 100% (101/101), 62.60 KiB, done.
Total 101 (delta 17), reused 0 (delta 0)
error: unpack should have generated 1f2087f7984f90b46a9cf90990d3399debedd3bc, but I can't find it!
To /cygdrive/H/backup-repo
 ! [remote rejected] master -> master (bad pack)
error: failed to push some refs to '/cygdrive/H/backup-repo'

Are there any known limitations of 开发者_如何学JAVAgit with Windows network drives, and are there any workarounds?

EDIT: I just found out: If I try calling the command git push backup again, it succeeds at the second or third try. However, calling the command again seems to be a bad solution, as I guess my repository might be corrupted when I get the message failed to push some refs. Any ideas what's happening here?


I've had problems trying to push to repositories over the network using Cygwin. Pulling has always worked, so I've tended to use that as a workaround.

If your workflow won't support that, you might find that setting up a git server allows you to get things working -- Gerrit works on Windows.

0

精彩评论

暂无评论...
验证码 换一张
取 消