【问题标题】:Getting <user>/.config/git/attributes': Permission denied, but /git doesn't exist获取 <user>/.config/git/attributes':权限被拒绝,但 /git 不存在
【发布时间】:2019-05-01 18:00:37
【问题描述】:

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

警告:无法访问/home/&lt;user&gt;/.config/git/attributes: 权限被拒绝

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

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

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

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

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

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

这是一个问题还是我可以放心地忽略它?

我该如何解决这个问题?

【问题讨论】:

  • Snips 服务器是在用户 &lt;user&gt; 还是其他用户下运行?在后一种情况下,它当然无权访问/home/&lt;user&gt;/
  • 我不确定技能安装在哪个用户下运行。我感觉它在我的用户下运行,因为稍后在安装过程中它无法创建 venv 目录,因为它没有所需的权限。

标签: git


【解决方案1】:

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

ls -ld ~/.config

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

source

【讨论】:

    【解决方案2】:

    解决方案:

    为此转到终端

    只需运行命令: sudo chmod 755 /Users/your-username/.config

    在你的情况下: sudo chmod 755 /home/your-username/.config

    【讨论】:

      猜你喜欢
      • 2017-12-25
      • 2017-12-02
      • 1970-01-01
      • 2019-05-27
      • 2021-09-18
      • 2016-10-30
      • 2020-07-30
      • 2011-12-15
      • 1970-01-01
      相关资源
      最近更新 更多