git status‘ failed with code 128:‘fatal: 解决方案(亲测有效!!!)

这篇博客介绍了如何解决Git仓库中索引文件损坏的问题。通过在终端中删除.index文件,然后使用`git add .`或者`git reset HEAD .`命令可以尝试修复。如果问题由子模块冲突引起,建议检查并解决子模块问题。作者建议在操作前备份仓库,并在成功后通过评论反馈。
摘要由CSDN通过智能技术生成

sourceTree

正在上传…重新上传取消​Kieran Senior [Atlassian] added a comment - 18/Dec/2013 9:42 AM

Hey Ray,

This is because your index file has been corrupted. You could do the following. Using the terminal and changing your directory to your repository you can do the following (making sure you back up your repository first, just in case):

 
  1. rm .git/index

  2. git add .

Or if you have changes in your working directory you want to keep you can do the following:

 
  1. rm .git/index

  2. git reset HEAD .

This can also be caused by conflicts with submodules, so if you have any submodules it might be worth looking into it.

Try that out and if it works if you could comment back to let me know that'd be great.

Thanks!

转载于:https://my.oschina.net/u/1177694/blog/647305

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值