hubring

git pull시 "untracked working tree files overwritten" 에러 본문

git

git pull시 "untracked working tree files overwritten" 에러

Hubring 2020. 7. 11. 00:19

sourceTree를 이용하여 git pull 하다가 메모리 문제였는지 중간에 멈춰버려
끄고 다시 pull을 하였으나  

untracked working tree files overwritten 오류가 발생하였다...

error: The following untracked working tree files would be overwritten by merge: 오류 발생한 파일 위치 및 이름
Please move or remove them before you can merge.
Aborting

 

이경우 아래 명령어로 쉽게 해결가능하다.
아래 명령어로 추적되지 않은 파일들을 모두 지울 수 있다.

$ git clean -d -f -f

 

 

git clean은 일반적으로 테스트 용도의 파일이나 임시 파일 등이 쌓였을 경우 사용하기 좋다.

주의할 점은 작업중인 파일이 Stash하지 않은 경우 사라질 수 있으므로
git stash를 확인하여 작업 중인 파일이 있는지 확인 후 사용하기를 추천한다.

 

git clean

https://git-scm.com/docs/git-clean

 

Git - git-clean Documentation

When the command enters the interactive mode, it shows the files and directories to be cleaned, and goes into its interactive command loop. The command loop shows the list of subcommands available, and gives a prompt "What now> ". In general, when the prom

git-scm.com

 

참고

https://devonaws.com/git/git-pull-%EB%AA%85%EB%A0%B9-%EC%8B%9C%EC%97%90-untracked-working-tree-files-overwritten-%EB%82%98%EC%98%AC-%EB%95%8C/

 

git pull 명령 시에 untracked working tree files overwritten 나올 때 - 데보나스 - DEVelopment ON AWS

git pull 명령으로 git 저장소에 올려진 commit 을 내려받습니다. $ git pull origin master  ...

devonaws.com

 

'git' 카테고리의 다른 글

Github 위키 다른 레포의 위키로 옮기는 방법  (0) 2021.02.24
git Fork 한 Repository 동기화  (0) 2020.07.11