Bite Bits/Git

현재 git 브랜치에서 local (untracked) files 지우기

상영 2015. 11. 13. 17:25


파일 지우기  git clean -f 

어떤 파일이 지워지는지 보기  git clean -f -n 

디렉토리를 지우기 원하면  git clean -f -d  또는  git clean -fd

ignored files 를 지울 땐,  git clean -f -X  또는  git clean -fX

ignored files 와 non-ignored files 상관없이 지우기  git clean -f -x  또는 git clean -fx

(*주의 'X' 와 'x' 는 다르게 동작, 대소문자 가림)


If clean.requireForce is set to "true" (the default) in your configuration, 

then unless you specify -f nothing will actually happen.


원문 : http://stackoverflow.com/questions/61212/how-do-i-remove-local-untracked-files-from-my-current-git-branch