在 git shell 中时的 GitHub 错误 "fatal: bad config file line 1 in .git/config"

标签 git shell github config

我在 Windows 上使用 GitHub,一直以来都运行良好,今天打开它时,它显示:

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 或任何其他命令时,它返回此错误:

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

不知道该怎么办?我读到有人说要用它的早期版本替换配置文件,但我没有早期版本..

最佳答案

我解决了这个问题

  1. 打开 .git/config 文件
  2. 清除文件中的所有NULL值
  3. 保存并关闭文件
  4. git 添加。

关于在 git shell 中时的 GitHub 错误 "fatal: bad config file line 1 in .git/config",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27073427/

相关文章:

git rebase 丢失历史,那为什么要 rebase?

ios - Mac OS 安装 MongooseIM 失败

linux - 寻找 。 -type -exec fgrep 问题

git - 仅发布某些 git 分支

Github 永久删除里程碑选项

macos - SSH key 在 Gitlab 上不断要求输入密码

windows - Git - 推送新的提交并忽略未提交的更改

linux - 对 txt 文件进行排序,查找重复项,同时打印在其中找到的行

linux - 在 shell 中将 2 个文件合并为 1 个文件

git - 上传本地仓库到 github.com