Tuesday, August 06, 2013

Typical .gitignore for Java Projects


I'm sure that every developer have some basic (skeleton) .gitignore file which is coping from project to project :-)

As a Java developer I'd like to talk about typical .gitignore file which can be added at the beginning the project (a la initial commit).

I've been using Github collection of useful .gitignore templates. It's very useful repo contains tons of standard .gitignores. General workflow is to assemble my .gitignore based on several templates:
But recently I've found very nice service gitignore.io which can generate nicely assembled .gitignore based on provided criteria:

Here is the generated file:
 
# Generated by http://gitignore.io

### Java ###
*.class

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

### IntelliJ ###
*.iml
*.ipr
*.iws
.idea/

### 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

### Maven ###
target/

Very convenient. Have a try.