gpt4 book ai didi

windows - 无法在网络驱动器上克隆 GIT 存储库

转载 作者:可可西里 更新时间:2023-11-01 13:26:39 26 4
gpt4 key购买 nike

使用 Windows 7,我们在网络驱动器上设置了一个裸 GIT 存储库,以便多个用户可以从中 pull/推送。我能够在我的本地和多个其他网络驱动器上创建一个新的工作仓库。但是,当我尝试在同一个网络驱动器(不同的文件夹)上克隆一个新的工作存储库时,它失败了。

使用 TortoiseGIT,在我右键单击并选择“GIT 克隆”后,将所有必要的路径放入我的裸仓库(新的工作仓库已经填写)并点击确定,我收到以下错误:

Cloning into 'R:\path\to\new\repo'... done. 
error: refs/remotes/origin/master does not point to a valid object!
error: Trying to write ref refs/heads/master with nonexistent object 5d2164db2c61efc7a5598f6ff75ed3fbbb12456e
fatal: Cannot update the ref 'HEAD'.
fatal: The remote end hung up unexpectedly git did not exit cleanly (exit code 128)

它无法创建存储库。但是,它确实构建了新文件夹和“.git”子文件夹结构。

这不是 r/w 权限问题,因为我可以 r/w 任何其他文件,但似乎无法创建这个新克隆的 repo。我的同事也不能。即使我到达网络驱动器上的另一个文件夹,我仍然无法成功克隆 repo。令人惊讶的是,如果我只是复制/粘贴我在另一个位置创建的存储库,然后手动执行“pull ”,它会成功运行并更新。

关于接下来要尝试什么有什么想法吗?显然,我用 Google 搜索了“退出代码 128”和“无法更新引用‘HEAD’”,但找不到解决我的问题的方法。这可能是我们忽略的非常简单的事情,但我们才刚刚开始使用 GIT,这确实让我们头疼......

更新:我刚刚注意到,当我从 GIT 手动 pull 到我的“副本”时,它正在快进。也许这提供了一些额外的线索?

From R:/path/to/repo
* branch master -> FETCH_HEAD
Updating 5d2164d..d75bdb7
Fast-forward
Files.py | 3 +++
1 file changed, 3 insertions(+)
Success

最佳答案

Git 可能会尝试使用在网络驱动器上失败的硬链接(hard link)来做一些聪明的事情。尝试使用 git clone --no-hardlinks/r/path/to/my/repogit clone file:///r/path/to/my/repo

关于windows - 无法在网络驱动器上克隆 GIT 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13714151/

26 4 0
文章推荐: php - PHP 数组键可以有别名吗?
文章推荐: angularjs - 使用 $index 在 ng-repeat 中间添加
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com