Cannot use git: "git fatal: an unknown error occurred while reading configuration files"

I can not use any git commands, all of them lead to the following error:

fatal: unknown error occurred while reading the configuration files

Git worked fine until it replaced the hard drive. I created a Windows 10 system image and restored it to my new hard drive, and then merged the unallocated disk space into my main partition.

I tried reinstalling and installing git, restarting my computer and deleting .gitconfig files and almost any combination of these actions.

+1
source share
4 answers

For me, the problem was .gitconfigfolder / dir in Users //. Removing dir .gitconfigresolved the issue and now it works fine.

screenshot for solution

+2

( , , .)

. git_config_raw config.c.

, do_git_config_sequence .

, , , git_config_from_file , , , , , , , , , , .

( , Windows) , .

+1

What was eventually fixed was to set the HOME environment variable to indicate something reasonable. Once that was done, git started behaving again again

0
source

A similar problem here. It was fixed by deleting the git configuration file in the HOMEDRIVE/ folder HOMEPATH.

0
source

Source: https://habr.com/ru/post/1689165/


All Articles