首页 > 解决方案 > 远程共享的 Git 克隆/推送/拉取失败

问题描述

我们中的一些人在网络共享(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: unset GIT_DIR; 'git-upload-pack'''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'

标签: windowsgit

解决方案


我在工作中具有完全相同的设置,具有相同的网络驱动器(也称为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

推荐阅读