.gitignore 는 이미 추적 중인 파일에 적용되지 않는다 — 인덱스에서 빼고(--cached) 다시 add 해야 규칙이 먹는다.1
# .gitignore가 규칙이 적용되지 않을때
git rm -rf --cached .
git add .
Footnotes
-
Git - gitignore Documentation — DESCRIPTION: “Files already tracked by Git are not affected” / NOTES: “To stop tracking a file that is currently tracked, use git rm –cached to remove the file from the index.” ↩