坏的git配置文件.git / config [英] Bad git config file .git/config

查看:1734
本文介绍了坏的git配置文件.git / config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的git版本中,每当我执行任何git命令(如 git status git log )时,错误:

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

如何重建该文件或新建一个?

解决方案

对于那些触及到这个问题的人(我相信这是由于git mid init崩溃了)你有一个最近从你的git repo的.git /文件夹备份的配置文件,你可以通过替换现有的配置文件来修复它(任何ref的添加,因为副本显然需要重新添加) - 完全没有理想但比丢失更好所有提交。

In my git repositiory, whenever I do any git commands like git status or git log, I get the error:
fatal: bad config file line 1 in .git/config
How do I rebuild that file or a new one?

解决方案

For those hitting into this issue (I believe it's due to crashing out git mid init?) in windows, if you have a recent backup of the config file from your git repo's .git/ folder you can fix it by replacing the existing with it (any ref's added since the copy will obviously need re-adding) - not at all ideal but better than loosing all the commits.

这篇关于坏的git配置文件.git / config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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