あとから、.gitignoreを設置したけど、一発で.gitignoreを全体に反映させる。
一気に、レポジトリから削除(除外)
以下のコマンドで、.gitignoreから除外を反映させる
$ git rm --cached `git ls-files --full-name -i --exclude-from=.gitignore`
確認&反映
$ git status $ git commit -m 'Reflected .gitignore'
あとから、.gitignoreを設置したけど、一発で.gitignoreを全体に反映させる。
以下のコマンドで、.gitignoreから除外を反映させる
$ git rm --cached `git ls-files --full-name -i --exclude-from=.gitignore`
$ git status $ git commit -m 'Reflected .gitignore'