【问题标题】:Git clone/push/pull of a remote share fails远程共享的 Git 克隆/推送/拉取失败
【发布时间】:2020-09-09 11:55:20
【问题描述】:

我们中的一些人在网络共享 (u:\data\some_repo.git) 上使用裸存储库,这在预期的限制下运行良好

但是,就在最近,我无法执行与裸存储库相关的任何典型 git 活动:push pull clone。

所有活动都失败了:

致命:'u:\data\some_repo.git' 似乎不是 git 存储库致命:无法从远程存储库读取。

请确保您拥有正确的访问权限和存储库 存在。

我确实有访问权限,并且可以正常浏览此位置。如果我将 some_repo.git 复制到我的本地计算机并执行 git clone /c/Temp/some_repo.git 它可以工作。

没有延迟问题,我有完全的访问权限,我尝试在前面添加 file:///,但没有成功。 GIT_TRACE 不显示任何内容

GIT_TRACE=1 git clone "/u/data/some_repo.git" 12:52:37.433340 exec-cmd.c:237 跟踪:已解析的可执行目录: C:/STORAGE/Application/Git/mingw64/bin 12:52:37.435332 git.c:444
跟踪: 内置: git clone u:/data/some_repo.git 克隆到 'InternalTestInterface'... 12:52:38.129124 run-command.c:663
跟踪:run_command:未设置 GIT_DIR; 'git 上传包 '''u:/data/some_repo.git'''' 12:52:38.370091 exec-cmd.c:237
跟踪:已解析的可执行目录: C:/STORAGE/Application/Git/mingw64/libexec/git-core 12:52:38.370091 git.c:444 跟踪:内置:git upload-pack u:/data/some_repo.git 致命:'Hu:/data/some_repo.git' 没有出现 成为致命的 git 存储库:无法从远程存储库读取。

请确保您拥有正确的访问权限和存储库 存在。

知道如何解决这个问题

--更新--

根据要求,尝试执行 git init:

/u/data/test.git 
$ git init error: fstat on
//FQDN.com/site_###/Groups/data/test.git/.git/config failed: Invalid
argument fatal: could not set 'core.filemode' to 'false'

【问题讨论】:

    标签: windows git


    【解决方案1】:

    我在工作中使用完全相同的设置,使用相同的网络驱动器(也称为U:\!)

    我在某个时候遇到了同样的问题,显然是由于一些后台同步/备份过程正在处理 Git 裸存储库的一些文件。

    首先尝试看看是否可以重新创建一个单独的裸仓库,用于测试,然后推送到它:

    git init U:\data\test.git
    cd path\to\local\repo
    git remote add origin2 U:\data\test.git
    git push origin2 master
    

    【讨论】:

    • 感谢您的回复,我认为您可能是对的,但它试图弄清楚是什么。某些东西必须持有文件才能使 fstat 失败
    • @Naib 在我的情况下,它与备份有问题的 romaing profile (docs.microsoft.com/en-us/windows-server/storage/…) 有关。
    猜你喜欢
    • 2015-02-21
    • 2018-05-02
    • 2019-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多