Git 克隆:错误:chmod on失败:操作不允许

Git 克隆:错误:chmod on失败:操作不允许

我正在双重启动 fedora/windows 7,因此我在它们之间有一个共同的存储空间,我制作了一个小的 fat 分区,挂载自/etc/fstab

UUID=C37A-2B35 /transfer vfat users,umask=000 1 3

我正在尝试将我在 Linux 上的 git 存储库克隆到挂载点,这样我就可以让该项目在 Windows 上运行:

> git clone ~/myproject/ /transfer/myproject
Cloning into '/transfer/myproject'...
error: chmod on /transfer/myproject/.git/config.lock failed: Operation not permitted
error: chmod on /transfer/myproject/.git/config.lock failed: Operation not permitted
error: chmod on /transfer/myproject/.git/config.lock failed: Operation not permitted
error: chmod on /transfer/myproject/.git/config.lock failed: Operation not permitted
error: chmod on /transfer/myproject/.git/config.lock failed: Operation not permitted
error: chmod on /transfer/myproject/.git/config.lock failed: Operation not permitted
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我拥有完全写入权限,但 root 是所有者,这就是chmod失败的原因。我可以告诉gitchmod不需要吗?

一个解决方法是这样的,但这真的很愚蠢,我不应该这么做:

git clone ~/myproject/ /tmp/myproject && mv /tmp/myproject /transfer/

答案1

以下是对我有用的方法。更改设置fstab以将设备作为特定用户安装,如下所述这里。关键选项是uidgid,分别表示“用户 ID”和“组 ID”。我将它们都设置为我的用户名,并成功克隆。

希望这可以帮助。

相关内容