2016年12月13日火曜日

.gitignoreが反映されない場合

どうも、俺です。

.gitignoreに除外ファイル/ディレクトリを追記しても反映されない場合の対応方法についてめもめも。

1) キャッシュが効いてしまっているので削除します。
$ git rm --cached /path/to/directory (or file)

2) コミットします。

$ git add .gitignore
$ git add /path/to/directory (or file)
$ git commit -m "COMMIT MESSAGE"

以上でぇぇぇぇぇぇす。

※参照 .gitignore に設定を追加して反映させる: Qiita