一个git仓库通用的.gitignore文件.

简介

在eclipse中创建maven项目时会有很多的项目描述文件及编译文件,如.settings.classpath.projecttarget等,但是在push时不希望将这些文件push到Git远程仓库,那么这时可以使用.gitignore文件进行配置。

使用

只需要在项目的根目录下创建一个.gitignore文件,将下面的文件内容复制进去即可,在win下是无法直接创建.gitignore文件,可以使用编辑器(如editplus、sublime text等,不建议使用记事本编辑)的另存为保存为.gitignore

文件内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
## .gitignore for Grails 1.2 and 1.3

# .gitignore for maven
target/
*.releaseBackup

# web application files
#/web-app/WEB-INF

# IDE support files
/.classpath
/.launch
/.project
/.settings
/*.launch
/*.tmproj
/ivy*
/eclipse

# default HSQL database files for production mode
/prodDb.*

# general HSQL database files
*Db.properties
*Db.script

# logs
/stacktrace.log
/test/reports
/logs
*.log
*.log.*

# project release file
/*.war

# plugin release file
/*.zip
/*.zip.sha1

# older plugin install locations
/plugins
/web-app/plugins
/web-app/WEB-INF/classes

# "temporary" build files
target/
out/
build/

# other
*.iws

#.gitignore for java
*.class

# Package Files #
*.jar
*.war
*.ear

## .gitignore for eclipse

*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

## .gitignore for intellij

*.iml
*.ipr
*.iws
.idea/

## .gitignore for linux
.*
!.gitignore
*~

## .gitignore for windows

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

## .gitignore for mac os x

.DS_Store
.AppleDouble
.LSOverride
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

## hack for graddle wrapper
!wrapper/*.jar
!**/wrapper/*.jar

文章推荐

    留言