获取< user>/.config/git/attributes':权限被拒绝,但/git不存在 [英] Getting <user>/.config/git/attributes': Permission denied, but /git doesn't exist

查看:150
本文介绍了获取< user>/.config/git/attributes':权限被拒绝,但/git不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu 18.04.1.上设置Snips服务器.当我尝试安装一项技能时,会收到此消息,但是当我进行git clone时却不会发生.

I am setting up a Snips server on Ubuntu 18.04.1. When I try to install a skill I get this message but it doesn't happen when I git clone.

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

warning: unable to access /home/<user>/.config/git/attributes: Permission denied

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

I went to check the permissions for /git/ and found that the /.config/git directory doesn't exist.

我克隆了一个仓库,以为它可以创建/git目录,但是没有.

I cloned a repo thinking it might create the /git directory but it didn't.

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

I created the /git/ folder and got the same message

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

I also did: touch attributes and the error persisted.

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

I checked root/.config as recommended in another similar question but there is no .config in /root

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

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

Is this a problem or can I safely ignore it?

我该如何解决?

推荐答案

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

Check the permission of ~/.config directory. It may have incorrectly been set to root if you previously ran a command with sudo that created the ~/.config dir (such as sudo htop).

ls -ld ~/.config

# if the owner is root, then change the owner to your user
sudo chown -R $USER ~/.config

这篇关于获取&lt; user&gt;/.config/git/attributes':权限被拒绝,但/git不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆