Monday, June 11, 2012

Git Ignore for a Java Eclipse Project

Recently I started to play around a side projct again and I came to the sad conclusion that I've forgotten a lot about Git.  Among the things I've forgotten is how to create a gitignore file and even what to put in one.  There are plenty of tutorials on how to make a gitignore file out there, but I couldn't find any good examples of a gitignore file for a Java EE environment.  Luckily for me, I have some git master friends and they shared their gitignore with me and since I would like to remember it, here it is.

# Directories #
/build/
/bin/
target/
# OS Files #
.DS_Store
*.class
# Package Files #
*.jar
*.war
*.ear
*.db
######################
# Windows
######################
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
######################
# OSX
######################
.DS_Store
.svn
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
######################
# Eclipse
######################
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
/src/main/resources/rebel.xml
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
view raw .gitignore hosted with ❤ by GitHub

6 comments:

  1. Thanks man this is great and helpful!

    ReplyDelete
  2. Let's say I have my Eclipse repo ~/home/code/main, do i need to place my .gitignore inside main/ for it to work?

    ReplyDelete
  3. You produced some decent points there. I looked on the net for any issue and discovered most people may go in addition to with your website.
    custom software development
 

    ReplyDelete