기타

git 오류 : commit 및 push (Fatal : index.lock)

YUNYUN3915 2023. 5. 10. 15:54

종종 git에서 commit 또는 push 도중 오류로 git 명령이 동작하지 않는 경우가 있습니다. 

fatal 에러로 'index.lock 파일이 존재함'과 함께 아래와 비슷한 문구가 나옵니다.

 

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.

 

이럴 때 해결 방법입니다.

간단합니다.

 

 


 

 

✅ Fatal : index.lock

 

해결방법

 

 

local의 git 저장소 폴더로 이동하고

 

git 폴더 스크린샷
local 저장소의 git 폴더

 

git 폴더의 index.lock 파일이 존재 스크린샷
index.lock 파일이 존재함

 

index.lock 파일을 삭제하면 됩니다.

 

 

삭제 후 정상 동작하는 것을 확인할 수 있습니다.

 

 

 

 

 Fatal : index.lock - 끝

 

관련 포스팅

git 필수 명령어 모음 

git 가져오는 명령어 (clone, pull, fetch, rebase)

git reset : 커밋 취소 방법 (로컬 저장소)