idea提交代码忽略iml,idea,classes,target等

 - 或者在项目根目录下创建.gitignore文件,并添加

/*.iml
/.idea/
/.gitignore

//.gitignore只能忽略那些原来没有被track(之前没有add过)的文件,如果某些文件已经被纳入了版本管理中,则修改.gitignore是无效的。
// 先把本地缓存删除(改变成未track状态),然后再提交:
//git rm -r --cached target
//git rm -r --cached .idea

报错加 -f

the following file has staged content different from both the
file and the HEAD:
.idea/.gitignore
(use -f to force removal)

//git rm -r -f --cached .idea

相关文章:

  • 2022-12-23
  • 2021-06-24
  • 2021-05-26
  • 2021-09-26
  • 2021-07-13
  • 2021-08-27
  • 2021-06-19
猜你喜欢
  • 2022-01-04
  • 2021-07-03
  • 2022-12-23
  • 2022-01-12
  • 2021-06-02
  • 2021-05-21
相关资源
相似解决方案