Skip to content

Commit fcbf599

Browse files
committed
chore(gitignore): add comprehensive .gitignore for Java projects with IDE and OS-specific exclusions
What - Added a structured `.gitignore` covering: 1. **IDE-specific files** - IntelliJ IDEA (`*.iml`, `.idea/`, `out/`) - Eclipse (`.classpath`, `.settings/`, `bin/`) - NetBeans (`/nbproject/private/`, `/dist/`, `/nbbuild/`) - VS Code (`.vscode/`) 2. **OS-specific files** - macOS: `.DS_Store` - Windows: `Thumbs.db`, `desktop.ini`, `ehthumbs.db` 3. **Build artifacts** - Maven/Gradle output (`target/`, `build/`) - Compiled binaries (`*.class`, `*.jar`, `*.war`, `*.ear`) - Log files (`*.log`) 4. **Environment configs** - `.env`, `.env.local`, `*.env` (except `sample.env` for reference) 5. **GitHub Actions** - Ensured `.github/workflows/*.yml` files are **not ignored** to keep CI/CD intact. 6. **YAML configs** - Ignored only IDE/tool-generated YAML files (e.g., `.idea/*.yml`) - Kept application-level configs (`application.yml`) tracked. Why - To **avoid polluting Git history** with IDE, OS, and build-generated artifacts. - Keeps repository clean, portable, and focused only on **source code and essential configs**. - Ensures reproducibility while still preserving important environment samples (`sample.env`) and CI workflows. Logic - Grouped rules into logical sections (IDE, OS, Build, Env, CI). - Carefully scoped ignores to avoid accidental exclusion of required application files (`application.yml`, workflow `.yml`). - Provided balance between **developer convenience** (ignoring local/ephemeral files) and **project integrity** (keeping required configs). Key Takeaways ✔ Covers major IDEs: IntelliJ, Eclipse, NetBeans, VS Code. ✔ Prevents committing system junk files from macOS/Windows. ✔ Ignores build outputs and logs. ✔ Securely handles env files while preserving sample references. ✔ Keeps GitHub Actions workflows tracked. Signed-off-by: https://github.com/Someshdiwan <[email protected]>
1 parent 7267495 commit fcbf599

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ build/
7676
# Do NOT ignore workflow files
7777
!.github/workflows/*.yml
7878

79-
# ==============================
79+
8080
# YAML Configs (Safe Ignore)
81-
# ==============================
8281
# Only ignore IDE/tool YAMLs, not app configs like application.yml
8382
.idea/*.yml

0 commit comments

Comments
 (0)