致命:无法将“core.filemode”设置为“false”

问题描述

您好 this 帖子与我的问题相同,但解决方案并没有解决问题。

我试过 sudo,结果如下:

(base) me$ sudo git clone https://github.com/soobinck/roTarod_ML.git
fatal: Could not create work tree dir 'roTarod_ML': Permission denied

我的问题,和我上面提到的帖子一样,是:

(base) brclab@FAcmeD006068:/run/user/1000/gvfs/smb-share:server=files.ubc.ca,share=team/bnrc/ninc/Raymond Lab/SooBin$ git clone https://github.com/soobinck/roTarod_ML.git
cloning into 'roTarod_ML'...
error: chmod on /run/user/1000/gvfs/smb-share:server=files.ubc.ca,share=team/bnrc/ninc/Raymond Lab/SooBin/roTarod_ML/.git/config.lock Failed: Operation not supported
fatal: Could not set 'core.filemode' to 'false'

我会尝试 this solution,但由于我对 git 和远程计算机 (Linux) 不太了解,所以我不会尝试乱搞。

有人可以指导我如何克隆和拉取 git 存储库吗?谢谢。

解决方法

您似乎在 Linux 上使用 SMB 共享。当您在 Unix 系统上使用 Git 时,它需要一个文件系统,它可以使用 chmod(2) 更改文件的权限。在您的情况下,这不起作用,因此当 Git 在克隆过程中尝试向配置文件提供信息时,它失败了。

我的建议是您克隆到不在 SMB 挂载上的文件系统。 Git 通常需要一个 POSIX 兼容的文件系统,而在你的系统上,这不是一个。请注意,如果您使用 cifs 内核驱动程序挂载此文件系统而不是 gvfs,它可能对您有用。 gvfs 的保险丝安装并不总是暴露文件系统的所有正确功能,也不一定有效。