(20210301未解决)error: chmod on /path/.git/config.lock failed: Operation not permitted

  • 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

  1. Creating git repo on NTFS in Linux
  2. WSL 2: chmod on […]/.git/config.lock failed: Operation not permitted #6284
  3. Chmod/Chown WSL Improvements
  4. WSL Ubuntu Distro | How to solve Operation not permitted on cloning repository
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值