What is "/usr/local/etc/gitconfig"?

Hi, I'm a freeBSD bigginier.
When tryinug git command, on non-root user, I get an error message:

fatal: unable to access '/usr/local/etc/gitconfig' : Permission denied.

BUT there is no gitconfig file or directory not only in /usr/local/etc but also another directory like /etc/.
And when making '/usr/local/etc/gitconfig', permission is ok, I get same error message.

What does this error message mean?
 
Git was installed by pkg command. And then git command went well on non-root account. But no gitconfig ( or .gitconfig) file exists in /usr/local/etc/ , home or root dir.
Once, I accidently changed permission of /usr/local/etc, from defoult to non-root account (group is wheel). And I fixed permission to root:wheel.
Then I get " unable to access '/usr/local/etc/gitconfig' : Permission denied. " message.

I tried to make git-related-files, like /usr/local/bin/git, belong to non-root a ccount but still I've not resolved this problem.
 
With your helpful advice, I enabled git command without the error message. Thanks!

...But why the message about non-exist-file appeared?
 
...But why the message about non-exist-file appeared?
Probably a bit of a bug. By default git checks for 3 "levels" of configuration: repo (in the repository folder), user (in your home directory) and system (in the global system configuration, for Unix this is etc). My guess is that it couldn't access /usr/local/etc at all which made it go bonkers.

For the record: there's plenty of software which would run into serious problems if they couldn't access etc, but I agree that the error message itself is a little misleading.
 
I don't think the message is misleading, since it clearly states access denied. The problem is that probably the OP checked the file as root, not as a normal user that would have seen the same error on the console.
 
Again, I don't think the message is wrong, or we should redefine a lot of messages.

Code:
% mkdir foo
% chmod 000 foo
% ls foo/bar
ls: foo/bar: Permission denied

so Permission denied is something that did show up every time you try to access a file under a restricted directory. After all, how can you know a file is not there if you cannot list the directory?
 
Back
Top