JAVA .GITIGNORE
GitHub’s official Java .gitignore template.
GitHub’s official Java .gitignore template. It is maintained in GitHub’s public template collection and released under CC0-1.0.
USE
- Copy it to the repository root as
.gitignore. - Merge it with project-specific patterns; later patterns take precedence.
- Commit the result so every contributor uses the same rules.
NOTES
- The template is a starting point; remove patterns you do not need.
- Generated files should usually stay untracked.
SOURCE
https://github.com/github/gitignore/blob/main/Java.gitignore
FULL TEXT
# 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*
replay_pid*
VERIFY SHA-256
Download the file, then choose it here. The checksum is compared locally in your browser.
Expected affbdc2a83b7d656b98cb2f77f6c33e8ce8221919ea1a50d803b19647588f07d
CITE
JAVA .GITIGNORE (v1.0, 2026-11-04). Original. https://original.wales/files/gitignore-java/ SHA-256: affbdc2a83b7d656b98cb2f77f6c33e8ce8221919ea1a50d803b19647588f07d. Source: https://github.com/github/gitignore/blob/main/Java.gitignore.