Unity Editor 를 사용하다 보면 에디터만 켰는데도 수정되거나 추가된 파일들이 있는 경우가 있다. 서버 작업자 입장에서는 귀찮지만 업데이트 전에 날려버리는게 좋다.
$ git checkout -- .
checkout 명령어를 이용하면 수정된 파일들은 되돌릴 수 있다. 하지만 Untracked 파일들은 남아 있다.
$ git clean -f
Removing PpProgram/test.cpp
$ git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
PpProgram/cleantest/
git clean -f 명령어를 사용하면 Untracked 파일들을 삭제할 수 있다.
$ git clean -fd
Removing PpProgram/cleantest/
$ git status
nothing to commit, working tree clean
git clean -fd 를 사용하면 Untracked 디렉토리까지 삭제할 수 있다.
출처 : https://blog.outsider.ne.kr/1164
git이 추적하지 않는 untracked files 한꺼번에 삭제하기 :: Outsider's Dev Story
git으로 프로젝트를 관리하다 보면 untracked 파일이 쌓이는 경우가 종종 있다.(나만 그럴지도...) 저장소에 넣을 파일은 아니지만, 테스트용으로 로컬에서 임시로 만들었다거나 이미지 등의 파일을
blog.outsider.ne.kr
728x90