Matt Ke
Matt Ke

Reputation: 3739

Git ignores credentials stored in .git-credentials

I have two local repositories which are hosted on the same server and I have configured Git to store my credentials in the .git-credentials file via the following command.

git config credential.helper store

However, the fetch/pull/push without entering credentials only work in one repository. In the other repository, Git always asks for credentials and ignores the .git-credentials file.

Upvotes: 2

Views: 2281

Answers (1)

Matt Ke
Matt Ke

Reputation: 3739

I have solved my problem. My config command was missing the global option. Without this option I have only configured it for one repository.

The correct command would have been:

git config --global credential.helper store

Upvotes: 8

Related Questions