투케이2K

56. (Bitbucket/Git) [에러 해결] fatal: Unable to create '.../.git/index.lock': File exists 본문

비트버킷 & Git

56. (Bitbucket/Git) [에러 해결] fatal: Unable to create '.../.git/index.lock': File exists

투케이2K 2024. 6. 24. 19:40
반응형

[환경 설정]

저장소 : Bitbucket / Git

사용 목적 : 소스 코드 버전 관리 실시

 

[에러 원인]

[1] : git 디렉토리에 index.lock 파일이 존재하기 때문에 git add 를 할 수 없어 발생하는 이슈

fatal: Unable to create 'C:/Users/ghkwon1/Desktop/AndroidProjectSave/twokProject/.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.
 

[해결 방법]

방안 [1] : 프로젝트 디렉토리 접속 > .git 폴더 접속 > index.lock 파일 삭제 수행

방안 [2] : git bash 등 명령어 도구를 사용해 해당 디렉토리 경로까지 이동 (cd) > index.lock 파일 삭제 수행

>> 명령어 : rm -f .git/index.lock


 

반응형
Comments