Commit fcbf599
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
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | | - | |
82 | 81 | | |
83 | 82 | | |
0 commit comments