- 从git中删除文件
$ git rm --cached logs/xx.log
- 然后更新 .gitignore 忽略掉目标文件
- 最后提交
$ git commit -m "We really don't want Git to track this anymore!"
$ git rm --cached logs/xx.log
$ git commit -m "We really don't want Git to track this anymore!"