Git 克隆:错误:<ntfs mount> 上的 chmod 失败:不允许操作

joz*_*yqk 7 linux mount git permissions

我是双引导 Fedora/Windows 7,所以我在它们之间有一个共同的存储位置我做了一个小的胖分区,从/etc/fstab以下位置安装:

UUID=C37A-2B35 /transfer vfat users,umask=000 1 3
Run Code Online (Sandbox Code Playgroud)

我正在尝试将 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.
Run Code Online (Sandbox Code Playgroud)

我有完整的写权限,虽然 root 是所有者,这就是chmod失败的原因。我可以告诉git不要chmod因为它不需要吗?

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

git clone ~/myproject/ /tmp/myproject && mv /tmp/myproject /transfer/
Run Code Online (Sandbox Code Playgroud)

小智 7

这对我有用。更改fstab设置到设备安装为一个特定的用户,如所描述这里。关键选项是uidand gid,大概分别是“user id”和“group id”。我将它们都设置为我的用户名,并且能够成功克隆。

希望这可以帮助。