4.5 KiB
.gitignore Configuration for JPD Portal
This document explains the .gitignore configuration for the JPD Portal project.
Critical Files Protected
The following sensitive files are NEVER committed to version control:
🔐 Security & Credentials
src/JPD.env- Contains API keys (Jira, Confluence, Claude API)*.envfiles - All environment variable filessecrets.json- ASP.NET Core user secrets
💾 Databases & Data
src/JpdPortal/data/vectors.db- SQLite vector embeddings databasesrc/JpdPortal/data/uploads/*- User-uploaded requirements files (except .gitkeep)- All
.db,.sqlite,.sqlite3files
🏗️ Build Artifacts
bin/andobj/directories - .NET build outputsDebug/andRelease/- Build configurations*.dll,*.exe,*.pdb- Compiled binaries
Directory Structure Preservation
Some directories need to exist but their contents should not be committed:
src/JpdPortal/data/
├── uploads/
│ └── .gitkeep ← Tracked to preserve directory
│ └── *.txt ← Ignored (user uploads)
└── vectors.db ← Ignored (SQLite database)
The .gitkeep file ensures the uploads/ directory structure is preserved in git.
Pattern Categories
The .gitignore is organized into these sections:
- Claude Code - IDE-specific files
- Project-Specific Sensitive Files - JPD.env, databases, uploads
- .NET Core / ASP.NET Core - Build artifacts, Visual Studio files
- AI/ML Specific - ONNX models, training artifacts, vector databases
- Blazor Specific - WebAssembly cache, generated assets
- Testing - Test results and coverage reports
- Environment Variables & Secrets - All .env files
- Database Files - SQLite and other database files
- Logs - Application log files
- OS Files - Windows, macOS, Linux system files
- Backup Files - .bak, .old, .tmp files
- Node.js - npm packages (if used for frontend)
- Python - pycache, venv (if used for ML scripts)
Already Tracked Files
If you see modified files in bin/ or obj/ directories that should be ignored, they were tracked before the .gitignore was updated. To remove them:
# Remove build artifacts from git tracking
git rm -r --cached src/JpdPortal/bin/
git rm -r --cached src/JpdPortal/obj/
# Commit the changes
git commit -m "chore: remove build artifacts from git tracking"
Note: The --cached flag removes files from git tracking but keeps them on your local filesystem.
Verifying Ignore Patterns
To check if a file will be ignored:
# Check specific files
git check-ignore -v src/JPD.env
git check-ignore -v src/JpdPortal/data/vectors.db
# Check entire directory
git check-ignore -v src/JpdPortal/bin/*
Expected output for ignored files:
.gitignore:199:*.env src/JPD.env
Best Practices
✅ DO:
- Always verify
src/JPD.envis NOT staged before committing - Check
git statusbefore commits to ensure no sensitive data - Use
git check-ignoreto verify patterns - Keep the .gitkeep file in the uploads directory
❌ DON'T:
- Never commit API keys or credentials
- Never force-add ignored files with
git add -f - Don't commit build artifacts (bin/, obj/)
- Don't commit database files with user data
- Don't commit user-uploaded files
Emergency: Removing Sensitive Data
If you accidentally committed sensitive data (like JPD.env), you need to remove it from git history:
# Remove file from git history (WARNING: rewrites history)
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch src/JPD.env" \
--prune-empty --tag-name-filter cat -- --all
# Force push (if already pushed to remote)
git push origin --force --all
Better approach: Use GitHub's BFG Repo-Cleaner or contact repository admin.
Environment Setup for New Developers
When cloning this repository:
-
Copy the environment template:
cp src/JPD.env.example src/JPD.env -
Edit
src/JPD.envwith your credentials -
Verify it's ignored:
git status # Should NOT show JPD.env as untracked -
Create necessary directories:
mkdir -p src/JpdPortal/data/uploads
Maintenance
Review and update this .gitignore when:
- Adding new services with credentials
- Adding new ML models or data storage
- Changing build output directories
- Adding new tools or frameworks
- Team reports accidental commits of ignored files
Last Updated: 2025-10-20 Project: JPD Portal v1.0.0