GitHub错误“致命:.git / config中错误的配置文件第1行”在git shell中时 [英] GitHub error "fatal: bad config file line 1 in .git/config" when in git shell

查看:188
本文介绍了GitHub错误“致命:.git / config中错误的配置文件第1行”在git shell中时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上使用GitHub,并且在整个过程中都正常运行之后,今天我打开它时,它说:

Im using GitHub on Windows and after working fine for the whole time, when I opened it today, it says:


失败加载此存储库的提交历史记录。您可能需要
打开外壳程序并调试此存储库的状态。

Failed to load commit history for this repository. You might need to open a shell and debug the state of this repo.

然后:


无法获取分支机构列表。

Failed to get list of branches.

我打开shell并尝试 git status 或任何其他命令,它将返回此错误:

When I open shell and try git status or whatever other command, it returns this error :


致命:.git / config中错误的配置文件第1行

fatal: bad config file line 1 in .git/config

不知道该怎么办?我读过有人说用较早的版本替换配置文件,但是我没有较早的版本。.

Not sure what to do with that? I read someone saying to replace the config file with an earlier version of it, but I dont have an earlier version..

推荐答案

我的问题可能有点含糊,但是我不确定自己发生了什么。通过使用Windows搜索在笔记本电脑上找到.git / config文件并将其删除,我解决了该问题。然后我删除了我的github文件夹中的内容,并再次克隆了存储库,并且在::

My question might have been abit vague, but I wasnt sure myself what happened. I solved it by finding .git/config file on my laptop using Windows search , and deleting it. Then I deleted content of my github folder and cloned the repo again and it worked after :)

这篇关于GitHub错误“致命:.git / config中错误的配置文件第1行”在git shell中时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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