如下:
先在用户目录中创建一个"git.ignore"的文件,名称随意,但后缀名不能错
------------------------------------------------------------------------
# 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*
.classpath
.project
.settings
target
.idea
*.iml
----------------------------------------
然后找到".gitconfig"的文件打开
设置引用
----------------------------------------------------------------------------------
[core]
excludesfile = C:/Users/"这里改成具体名称"/git.ignore
--------------------------------------------------------------------------------------------
注意:这里要使用“正斜线(/)”,不要使用“反斜线(\)”