0
点赞
收藏
分享

微信扫一扫

fatal: could not create work tree dir ‘xxxx’: Permission denied

M4Y 2022-01-13 阅读 92
git clone --recursive git://github.com/isaacs/npm.git

在执行上面命令从git上clone的时候报了错误,报这个错误的原因就是正在写入或者克隆git仓库的那个目录没有写入的权限。

fatal: could not create work tree dir 'npm': Permission denied

解决办法就是先修改目录的权限然后在进行操作

$ cd ../    (回退到当前目录的上一级)
$ sudo chmod o+w dirname  (dirname为当前目录的名字)

如果有密码的可能会提醒你输入密码,然后就可以重新执行git clone命令了

fatal: could not create work tree dir ‘xxxx’: Permission denied

举报

相关推荐

0 条评论