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

前言

今天在git上down代码的时候提示:fatal: could not create work tree dir ‘xxxx’: Permission denied

叙述

出现这个错儿的主要原因就是因为:The directory in which you are trying to write the file or taking the clone of git repository, it does not has the write permission. That’s why this problem is occurring.
Please change the write permission of directory.
Then clone the repository.(一句话说白了就是没有权限)

解决方案1:

#此方法已验证

# go to any other directory where you have the permissions to write to
cd <some path>

# Check to see if you have permissions:
mkdir dummy

# Now once you have verified that you have write permissions -
# clone the project from the command line
git clone <url>

解决方案2:

In my case what happened was that the user I was using had no ownership over the directory. I simply had to change ownership of the directory to that user. For example if user is ubuntu:

#此方法未验证
chown ubuntu:ubuntu -R directory-in-question

cd directory-in-question/

git clone <git repo comes here >

黑色背景

小结

不积跬步无以至千里
感谢您的阅读~~

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值