🔒 Security Checklist - Before Pushing to Git
✅ Protected Files (Should NOT be in git)
✅ Safe Files (Can be committed)
Check what git will commit:
Check for any sensitive files that might be tracked:
git ls-files | grep -E " (json|key|token|credential|excel|csv)"
Check for API keys in your code:
grep -r " AIza" . --exclude-dir=venv --exclude-dir=.git
🚨 If You Find Sensitive Data
Remove from git tracking:
git rm --cached < filename>
echo " <filename>" >> .gitignore
Check git history for sensitive data:
git log --all --full-history -- < filename>
Never commit API keys - Use environment variables
Never commit personal data - Keep job files local
Use .env files for local configuration
Regular security audits of your repository
Rotate API keys if accidentally exposed
🆘 If You Accidentally Commit Sensitive Data
Immediately revoke any exposed API keys
Remove from git history using git filter-branch or BFG
Force push to overwrite remote history
Notify collaborators to update their local repos
Generate new credentials and update local configs