0

I have a ~/.gitconfig file, and I have installed pm2 which creates a folder called ~/config/.

After that, Git assumes that pm2's ~/.config/ folder is where it will find it's settings (spoilers: it's not).

How do I tell Git to stop looking in ~/.config/ and just use good old ~/.gitconfig?

4
  • Does ~/.config/git/config exist? Commented Jun 25, 2017 at 21:59
  • @Collin Nope. The .config folder only contains /configstore/ (pm2 stuff). Commented Jun 25, 2017 at 22:10
  • Weird, so looking at the documentation it seems to say git will only use the .config directory if the git config file exists within it. In fact, that's exactly what it does on my machine. Commented Jun 25, 2017 at 23:34
  • Yep. And it fails if it is unable to check whether the git config file exists within (because of permissions). That may be undesirable. Commented Jun 26, 2017 at 12:22

3 Answers 3

2

Typing man git config has a section called FILES that lists the locations of all the system files. The global Git config file is in ~/.gitconfig, but there's also a "system" config file, that's usually in /etc/gitconfig.

Sign up to request clarification or add additional context in comments.

1 Comment

I solved it by chowning the folder, but this looks like it would work as well since Git would then consider /etc/gitconfig/ first.
1

Atlassian had the answer. Just chown the folder to allow Git to look through the folder, then Git will find nothing, and correctly move along to .gitconfig

sudo chown -R my_user:my_user ~/.config 

The folder should be owned by the user anyway, seeing as how it is in my user's home folder. Source: https://confluence.atlassian.com/stashkb/permission-denied-on-git-config-file-314447088.html

Comments

0

The name of the file must be .gitconfig.

What you can do it to set an alias ~/.config/ to point to ~/.gitconfig/

1 Comment

Thing is, I still need the .config folder for pm2.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.