git取消跟踪文件
参考文章:
https://www.cnblogs.com/toward-the-sun/p/6599656.html
第一次使用git向远程分支推送内容时,使用.gitignore可以排除掉不需要推送的文件,比如配置文件等,但有时候有些文件忘记添加到.gitignore中了,后面又想取消跟踪这些文件,这时发现修改.gitignore不管用了。
可以使用git rm --cached命令
git rm --cached file_path
--cached表示删除暂存区上的文件,如果想要连工作区上的文件也删除,不需要加--cached,即
git rm file_path