250x250
반응형
05-08 08:35
Today
Total
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Notice
Recent Posts
Recent Comments
Link
Archives
관리 메뉴

Bill Kim's Life...

[Git 에러] Another git process seems to be running in this repository(갑자기 잘 사용하던 Git이 안될 때) 본문

DEV Tips/Git

[Git 에러] Another git process seems to be running in this repository(갑자기 잘 사용하던 Git이 안될 때)

billnjoyce 2020. 12. 17. 09:56
728x90
반응형

[이슈 내용]

 

Git을 사용하다보면 아래와 같이 에러와 함께 Commit 및 Push가 안되는 경우가 있습니다.

 

 

현재 다른 프로세스에서 git 프로세스가 동작하고 있어서 index.lock 파일에 의해서 뭔가 락이 걸린듯한 상황입니다.

위의 걸린 락을 풀기 위해서는 바로 아래에서 Terminal 및 Command 툴로 아래의 명령어로 간단하게 해결 가능합니다.

 

위의 스샷 외에도 아래의 에러들도 같은 방법으로 해결 가능합니다.

 

 

 

관련 에러1

 

fatal: Unable to create 'repository/.git/index.lock': File exists. 
If no other git process is currently running, this probably means a git process crashed in this repository earlier. 
Make sure no other git process is running and remove the file manually to continue.

 

관련 에러2

 

fatal: Unable to create 'repository/.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 저장소 폴더 상단으로 이동합니다.

2. 해당 폴더를 루트로 하여 맥의 경우 Terminal을 윈도우의 경우 Command Line Tool(CMD) 를 실행합니다

    또는 Terminal 및 커맨트 툴을 바로 실행 후 'cd "Git 저장소 폴더 경로"' 명령어를 실행하여 해당 폴더로 이동합니다.

3. 아래의 커맨드를 입렵합니다.

    rm -f ./.git/index.lock

 

 

해당 명령어를 입력 후 다시 Git 클라이언트 툴 및 커맨드 라인 등으로 커밋 및 푸시를 하면 정상적으로 되는 것을 확인할 수 있습니다.

 

 

그럼 혹시나 Git을 사용하시다 문제가 생긴 경우 당황하지 마시고 오늘 알려드린 팁으로 간단히 해결을 하시길 바랍니다. ^^

 

 

감사합니다.

 

 

728x90
반응형

'DEV Tips > Git' 카테고리의 다른 글

[Git] Commit 되돌리기  (0) 2022.09.10
Comments