插件.ignore的使用

1.在推送文件到gitee或者github时,有一些文件不需要发送,例如.iml,.class等
2.插件.ignore可以解决这个问题,首先下载.ignore插件,安装重启idea
插件.ignore的使用_第1张图片
3.idea重启后选中项目右键选择new
插件.ignore的使用_第2张图片
4.之后选择模板
插件.ignore的使用_第3张图片
5.这样,就会生成一个.gitgnore文件,可以自己定义忽略文件

### Java template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Example user template template
### Example user template

# IntelliJ project files
*.iml
out
gen

**/mvnw
**/mvnw.cmd
**/.mvn
**/target/
**/.gitignore

6.注意事项
 a)使用.ignore插件生成忽略文件的作用范围是当前文件所在目录,以及其目录下的所有文件.因此,想要.ignore文件生效,应当将它放在项目目录下,这样就对整个项目的文件生效了

你可能感兴趣的:(git,idea2020,intellij-idea,java)