获取 <user>/.config/git/attributes':权限被拒绝,但 /git 不存在

Hav*_*ock 1 git

我正在 Ubuntu 18.04.1 上设置 Snips 服务器。当我尝试安装技能时,我收到此消息,但当我 git clone 时,它​​不会发生。

警告:无法访问/home/<user>/.config/git/attributes:权限被拒绝

我去检查/git/的权限,发现/.config/git目录不存在。

我克隆了一个存储库,认为它可能会创建 /git 目录,但它没有。

我创建了 /git/ 文件夹并收到了相同的消息

我也这样做了:touch attributes并且错误仍然存​​在。

我按照另一个类似问题中的建议检查了 root/.config,但 /root 中没有 .config

我尝试过git config -l --show-origin,但没有结果

这是一个问题吗?或者我可以安全地忽略它吗?

我该如何解决这个问题?

wis*_*cky 5

检查目录的权限~/.configroot如果您之前运行了sudo创建该~/.config目录的命令(例如) ,则它可能被错误地设置为sudo htop

ls -ld ~/.config

# if the owner is root, then change the owner to your user
sudo chown -R $USER ~/.config
Run Code Online (Sandbox Code Playgroud)

来源