Unable to access 'git/attributes'

后端 未结 6 830
感动是毒
感动是毒 2020-11-29 18:23

What does warning remote: warning: unable to access \'/root/.config/git/attributes\': Permission denied means and what implications does it bring?



        
6条回答
  •  粉色の甜心
    2020-11-29 18:50

    I ran into this situation myself. After verifying that it was looking in ~/.config/ I noticed the owner of that folder was root. I changed this to my_user_name and it worked.

    cd ~/
    ls -al
    
    sudo chown -R $(whoami) .config
    

    It helps to know the cause as well: This directory is created the first time you run a program that uses it. If the command was run as root, it will cause this permissions problem.

    For example, if the ~/.config directory does not yet exist, and you run sudo htop, the directories ~/.config and ~/.config/htop will be created and owned by root. Afterward, a regular git command wont be able to access ~/.config and will give the above warning. (Credit: user mehtunguh)

    The -R option with chown is to modify the permissions recursively. This will help if you have subfolders under ~/.config

提交回复
热议问题