git设置Eclipse中忽略的文件


GitHub 官网样例文件
https://github.com/github/gitignore
https://github.com/github/gitignore/blob/master/Java.gitignore

我在.gitconfig所在的目录下创建一个Java.gitignore(名称和位置随意,这样做主要是查找方便)

在刚刚创建的Java.gitignore文件中写入以下内容:

#官方忽略
# 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

保存,并关闭。

在.gitconfig文件中加入配置信息:

[core]
    excludesfile = C:/Users/Jack/Java.gitignore

配置成功后,eclipse会自动识别

重新启动eclipse,这时你想被忽略的文件就被成功忽略了。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM