我在 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
不知道该怎么办?我读到有人说要用它的早期版本替换配置文件,但我没有早期版本..
最佳答案
我解决了这个问题
- 打开 .git/config 文件
- 清除文件中的所有NULL值
- 保存并关闭文件
- git 添加。
关于在 git shell 中时的 GitHub 错误 "fatal: bad config file line 1 in .git/config",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27073427/