git 删除错误提交的文件

2020-03-09  本文已影响0人  良人与我

idea 项目 ,错误将 工具生成的 .idea 里的文件提交到 仓库
想要仓库里删除该文件,而本地继续保留
可以用如下git 命令

git rm --cached filename

看看该参数的说明

       --cached
           Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not,
           will be left alone.

参考地址
http://www.findme.wang/share/detail/id/437.html

上一篇 下一篇

猜你喜欢

热点阅读