-
Overview
如题
error: chmod on /path/.git/config.lock failed: Operation not permitted
-
问题分析
From R1, the reason is :
The linux command chmod is not supported by NTFS.
Solution which it suggest is :
mkdir -p /home/user/.gitconfigs/myrepo ln -s /home/user/.gitconfigs/myrepo .git
Proceed as before with “
git init
”R2描述的意思其实也差不多,主要就是文件系统导致的问题。
但是这个方法又出现运行ln命令时
not permitted
,总归是wsl2的挂载路径权限问题。我在
WSL2
中其他挂载的路径(电脑本机文件系统/mnt/f
)上git init
是成功的;出错的是网络硬盘挂载路径(/mnt/g
)。R4
提供的多种方案,都是针对本地计算机硬件磁盘可行,对于网络磁盘都是无效的。 -
查看磁盘性质
$ mount -l # 查看所有挂载路径 F:\ on /mnt/f type 9p (~,trans=fd,rfd=8,wfd=8) G: on /mnt/g type 9p (~,trans=fd,rfd=3,wfd=3)
可见区别如下两项。
-
naotime vs. relatime
-
rfd vs. wfd
-
References
(20210301未解决)error: chmod on /path/.git/config.lock failed: Operation not permitted
猜你喜欢
转载自blog.csdn.net/The_Time_Runner/article/details/114434655
今日推荐
周排行