코딩/Error

[git error] error: bad signature 0x00000000 fatal: index file corrupt

eunslog 2024. 11. 8. 10:09

vscode에서 코딩을 하다가.. 갑자기 노트북이 과부하가 왔는지 멈춰버렸다. (노트북 성능 때문에 예전에도 그랬었다.)

 

그래서 그냥 노트북을 강제종료 하고 다시 시작했다.

 

그리고 vscode를 들어갔는데..

 

source control에서 갑자기 uncommited changes가 다 사라져있었다..

 

git graph를 보려니깐 이렇게 떴다.

 

커밋 안한 코드들이 많은데..

 

콘솔창에 git status 명령어를 입력하니 다음과 같은 에러가 발생했다.

git status 명령어 입력 시 발생한 에러

 

구글링해 본 결과, 

git - How to fix the error: bad signature 0x00000000 index file corrupt - Stack Overflow

 

How to fix the error: bad signature 0x00000000 index file corrupt

I have not been able to update my repository because I'm getting this error below when I commit the project. I have been told to remove the index file and run these commands del .git\indexand git ...

stackoverflow.com

 

git bash에서 git status 명령어를 입력했는데 같은 에러가 발생했다.

 

 git bash에서

rm -f .git/index
git reset

 

입력

 

 

unstaged changes가 다시 잘 떴다.

 

source control과 git graph 모두 정상적으로 돌아왔다 휴 ㅠㅠ