简体   繁体   English

无法克隆网络驱动器上的GIT存储库

[英]Cannot clone GIT repository on network drive

Using Windows 7, we have a bare GIT repository set up on a network drive so that multiple users can pull/push from it. 使用Windows 7,我们在网络驱动器上设置了一个裸GIT存储库,以便多个用户可以从中拉/推。 I am able to create a new working repo on my local and multiple other networked drives. 我能够在我的本地和多个其他网络驱动器上创建一个新的工作仓库。 However, when I try to clone a new working repository on the same network drive (different folder) , it fails. 但是,当我尝试在同一网络驱动器(不同的文件夹)上克隆新的工作存储库时,它会失败。

Using TortoiseGIT, after I right-click and choose "GIT Clone", put in all of the necessary paths to my bare repo (the new working repo is already filled in) and hit ok, I get the following error: 使用TortoiseGIT,在我右键单击并选择“GIT Clone”后,将所有必要的路径放入我的裸仓库(新的工作仓库已经填写)并点击确定,我收到以下错误:

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)

and it fails to create the repo. 它无法创建回购。 It does however build the new folder & ".git" subfolder structure. 但它确实构建了新文件夹&“.git”子文件夹结构。

It's not ar/w permissions issue because I can r/w any other files, but just cannot seem to create this newly cloned repo. 这不是ar / w权限问题,因为我可以删除任何其他文件,但似乎无法创建这个新克隆的repo。 My co-worker cannot either. 我的同事也不能。 Even if I got to another folder on the network drive, I still cannot clone the repo successfully. 即使我到了网络驱动器上的另一个文件夹,我仍然无法成功克隆repo。 Surprisingly, if I just copy/paste a repo I created in another location, then manually do a "pull", it works and updates successfully. 令人惊讶的是,如果我只是复制/粘贴我在另一个位置创建的仓库,然后手动执行“拉动”,它可以正常工作和更新。

Any ideas on what to try next? 关于下一步尝试的任何想法? Obviously I've Googled "exit code 128" and "cannot update the ref 'HEAD'" but cannot find a solution to my issue. 显然我已经用Google搜索“退出代码128”和“无法更新参考'HEAD'”,但无法找到我的问题的解决方案。 It's probably something really simple that we are overlooking, but we're just getting started with GIT and this is really causing us headaches... 这可能是我们忽略的非常简单的东西,但我们刚刚开始使用GIT,这真的让我们感到头痛......

UPDATE: I just noticed that when I do a manual pull from GIT to my "copy", it is doing a Fast-Forward. 更新:我刚注意到当我从GIT手动拉到我的“副本”时,它正在进行快进。 Maybe this provides some additional clues? 也许这提供了一些额外的线索?

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

Git might be trying to do some smart stuff with hardlinks that fails on the network drive. Git可能会尝试使用网络驱动器上出现故障的硬链接做一些聪明的事情。 Try using git clone --no-hardlinks /r/path/to/my/repo or git clone file:///r/path/to/my/repo 尝试使用git clone --no-hardlinks /r/path/to/my/repogit clone file:///r/path/to/my/repo

Please do this via command line in msysgit 请通过msysgit中的命令行执行此操作

git clone /r/path/to/my/repo /r/some/other/path

Further, I would recommend using git from the command line as it is a tool that was designed to be used from the command line. 此外,我建议从命令行使用git,因为它是一个旨在从命令行使用的工具。 You will be able to find more help, faster, with any issues that come up for you. 您可以更快地找到更多帮助,解决任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM