Fatal : Unknown error while reading configuration files in git
If you are trying to clone a repository or trying to run git init and you are facing below error
Fatal : Unknown error in reading configuration files
Then you have come to right place. I faced this error today and for me error was because of incorrect setting of $HOME environment variable.
Sometimes your computer is joined to domain and because of some policy in Domain controller you $HOME variable is set to some shared drive.
In this article we will detect this problem and solve it.
Setting $HOME environment varriable
From windows start menu open git bash as administrator (right click on git bash app and right click >click run as administrator) and then type below command
echo $HOME
Have a look on directory returned from above command and close the git bash.
Open the git bash again with normal user (without running it as administrator) and run above command again.
And have a look on directory returned.
If there is a difference between the directory returned from both commands then this is the reason why git is not able to read configuration files.
To solve this issue follow below steps.
-
Open my computer or this PC > right click and open properties
-
Click on Advanced System settings and then click on Environment variables
-
Add a new Environment varriable HOME in user variables for your account if no HOME variable exists their as below
Click OK.
Restart your command prompt and try again. This solved my issue and it may solve yours
Would you like to see your article here on tutorialsinhand.
Join
Write4Us program by tutorialsinhand.com
About the Author
Mukesh Tiwari
Always ready to learn new technologies, A problem solver, exhibit to do attitude. Having around 10+ years of experience of development and management skills. I believe don't just set random goals but right goals suited for you.
Page Views :
Published Date :
Jul 12,2020