cygwin 上的 git 是否支持 Windows 网络共享上的存储库?

发布于 2024-10-20 02:20:06 字数 1160 浏览 2 评论 0原文

我尝试设置一个裸 git 存储库进行备份,如 nes1983这个问题

我在 cygwin 上使用 git。我的本地存储库位于 /cygdrive/C/my-project 上。当我在同一磁盘上设置备份存储库时,一切正常。

但是,如果我在网络驱动器 /cygdrive/H/backup-repo 上设置裸存储库,我会收到以下错误:

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 arethere are there anyknown Limits of git with Windows network drivers, and are there有什么解决方法吗?

编辑:我刚刚发现:如果我尝试再次调用命令git push backup,它会在第二次或第三次尝试时成功。然而,再次调用该命令似乎是一个糟糕的解决方案,因为我猜当我收到消息无法推送某些引用时,我的存储库可能已损坏。你知道这里发生了什么吗?

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 git 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦罢 2024-10-27 02:20:06

我在尝试使用 Cygwin 通过网络推送到存储库时遇到了问题。拉动总是有效的,所以我倾向于使用它作为解决方法。

如果您的工作流程不支持这一点,您可能会发现设置 git 服务器可以让您正常工作 - Gerrit 适用于 Windows。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文