.git/index.lock': File exists. 에러해결

devHagaa·2022년 3월 6일
0

이유는 모르겠지만 갑자기 커밋을 추가하려니 다음과 같은 에러메세지가 떴다.

fatal: Unable to create 'C:/Users/user/Desktop/project/6th-camp_us-fe/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

그래서 찾아본 해결법

rm .git/index.lock

을 하니까 해결이 되었다!

구글링 하다보니까 아래와 같은 해결법도 있었는데

rm -rf ./git/index.lock
rm .git/index.lock.

이 명령은 듣지 않았다. 혹시 모르니까 일단 기록해두고 다음에 같은 에러가 발생했을 때 시도해보려한다.

profile
디자이너인가 퍼블리셔인가 프론트엔드개발자인가 정체성의 혼란을 겪는 개린이

0개의 댓글