본문 바로가기

IT/Programming

git Unable to create '/path/.git/index.lock': File exists. 에러

 

git Unable to create '/path/.git/index.lock': File exists. 에러 해결법

 

git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/wy/pnr0y5613r3g9946v3w0j0p00000gn/T/SourceTreeTemp.CGJMzN
fatal: Unable to create '/path/.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.
Completed with errors, see above

 

 

아래 명령어를 해당 프로젝트 결로로가서 실행합니다.

/index.lock 파일을 강제로 삭제해주는겁니다.

 

rm .git/index.lock