无法使用git:"git致命:读取配置文件时发生未知错误" [英] Can't use git: "git fatal: unknown error occurred while reading the configuration files"

查看:608
本文介绍了无法使用git:"git致命:读取配置文件时发生未知错误"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能使用任何git命令,它们都会导致以下错误:

I can't use any git commands, they all result in the following error:

fatal: unknown error occurred while reading the configuration files

在我更换硬盘驱动器之前,Git工作正常.我创建了Windows 10系统映像并将其还原到新的硬盘驱动器上,然后将未分配的磁盘空间合并到我的主分区中.

Git was working fine up until I replaced my hard drive. I created a windows 10 system image and restored it on my new hard drive, and then combined the un-allocated disc space into my main partition.

我尝试重新安装和安装git,重新启动计算机并删除.gitconfig文件,以及几乎所有这些操作的组合.

I've tried re-installing and installing git, restarting my computer, and removing .gitconfig files, and pretty much every combination of those actions.

推荐答案

对我来说,问题是Users//中的.gitconfig文件夹/目录.删除目录.gitconfig解决了该问题,现在可以正常工作.

For me, the issue was .gitconfig folder/dir in Users//. Deleting the dir .gitconfig resolved the issue and it's working fine now.

这篇关于无法使用git:"git致命:读取配置文件时发生未知错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆