IDEA从Git repository中移除文件

来源:互联网 发布:vue webpack app.js 编辑:程序博客网 时间:2024/04/29 04:01

使用idea创建新项目提交git后,发现经常都有很多 idea目录下或者 iml文件有改动,这些本不需要提交

虽然加了.gitignore,由于这些已经加入过版本管理,所以.gitignore对他们无效

于是想办法把他们从版本库中移除,步骤如下:

1、使用git rm --cached -r 命令,从版本库中移除



2、提交本次修改

git commit -m "remove idea and iml files"

git push

3、添加.gitignore文件