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.

4 comments:

  1. These ignore patterns for eclipse really works?? I mean you are ignoring .classpath and .project. How this commit will work on other machine without these files?

    ReplyDelete
  2. Nice post it is very useful for me.
    Each and every year we are providing Cheap and best students project at Madurai.

    ReplyDelete