Git_Eclipse:[2]Git初始化配置

配置用户名邮箱

Window -> Preferences -> Team -> Git -> Configuration

 

配置文件过滤

新建一个*.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文件中指定*.gitignore文件路径

[user]
    name = test
    email = test@gmail.com
[core]
    excludesfile = C:/Users/Administrator/Java.gitignore  # 注意:路径这要使用"/",不能使用"\"

返回eclipse查看是否已读取*.gitignore文件

 

posted @ 2018-07-06 10:53  Catnip  阅读(501)  评论(0编辑  收藏  举报