파이썬/팁

Git the following untracked working tree files would be overwritten by merge

행복론자 2020. 3. 27. 00:15

git pull 명령어 실행 이후 종종 발생하는 

git the following untracked working tree files would be overwritten by merge 에러 해결 방법

 

해결방법1.

- 추적되고 있지 않은 파일 전부 다 삭제

- 복구가 안되니 뭐가 지워지는지는 알고 지워야 한다. 

$ git clean -d -f -f -n

 

 

해결방법2 

- git fetch를 통해 원격 저장소로부터 파일을 받기만 하고, branch 새로

(git pull은 원격 저장소로부터 파일을 받고, 병합시킴 이 과정에서 에러 발생한 케이스)

 $ git fetch --all
 $ git reset --hard origin/{branch_name}

 

 

 

반응형