I tried to clone a repo using GitKraken on Ubuntu, but it threw me an error "failed to open '/etc/gitconfig' - permission denied".
So I think GitKraken software needs to access a gitconfig file to get things work, and it somehow tried to access the one at /etc/gitconfig
first (which is locked - I don't even know what "lock" mean), so it threw the error. After googling, I found a solution sounds rational is to type chmod 777 /etc/gitconfig
to give everyone (includes GitKraken) the permission to read/write to that config file. But after doing that, it still not work (permission denied), even after a reboot. First attemption failed. Maybe it's not about permission?
I then kept googling, then I knew that there are 3 types of config files for git, which are local (located in .git/gitconfig
), global (in ~/.gitconfig
) and system (in /etc/gitconfig
). Then I thought "aha, I could just delete the /etc/gitconfig
, then Kraken will use ~/.gitconfig
". And yet after deleting /etc/gitconfig
, it works (I can clone my repo as expected). But I think it's just a workaround, I don't know what's the consequence of doing this (deleting system gitconfig). As I read in the document, it should first read the local one, then global, then system in order, so it should only read /etc/gitconfig
if only can't find one in ~/.gitconfig
, am I right? Why it isn't the case here? Or does GitKraken deliberately setting to read the config file from /etc/gitconfig
first instead of the above order?
Conclude, I deleted the system gitconfig /etc/gitconfig
(by renaming it to /etc/.gitconfig
btw). My question is what should I do now, did I solve my problem? If yet then now I don't fully understand what's going on, please can someone explain to me?
Thanks in advance.