Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

Unable to access 'git/attributes'

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

$git clone git://git.eclipse.org/gitroot/egit/egit.git
Cloning into 'egit'...
remote: warning: unable to access '/root/.config/git/attributes': Permission denied
remote: Counting objects: 57926, done.
remote: Compressing objects: 100% (11872/11872), done.
remote: Total 57926 (delta 30734), reused 56308 (delta 29136)
Receiving objects: 100% (57926/57926), 32.29 MiB | 1021 KiB/s, done.
Resolving deltas: 100% (30734/30734), done.
Checking out files: 100% (1483/1483), done.

Should I report potential infrastructure problem to hoster?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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
<Noticed .config was owned by root, unlike everything else in $HOME>
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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...