【Git】.gitignore自体を差分から除外する
# git ls-files --others --exclude-from=.git/info/exclude# Lines that start with '#' are comments.# For a project mostly in C, the following would be a good set of# exclude patterns (uncomment them if you want to use them):# *.[oa]# *~.DS_Store.gitignore<PROJECT>/.git/info/excludeに上記のように追記するだけ。
もちろん.gitignoreに記載したファイルの無視も変わらず機能する。
git rm -r --cached .gitignoreしかし.gitignoreが既にGit管理(コミット)されている場合、上記のようにキャッシュ削除しないと無視は機能しない。