Skip to content

Replace .gitkeep with .gitignore in tmp directory#289

Merged
nhorton merged 2 commits intomainfrom
claude/add-deepwork-gitignore-V9lOS
Mar 25, 2026
Merged

Replace .gitkeep with .gitignore in tmp directory#289
nhorton merged 2 commits intomainfrom
claude/add-deepwork-gitignore-V9lOS

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Mar 24, 2026

Summary

This change improves the git management of the .deepwork/tmp directory by replacing the .gitkeep approach with a proper .gitignore file that explicitly ignores all temporary contents while keeping the .gitignore itself in version control.

Key Changes

  • Replaced .gitkeep with .gitignore: The .deepwork/tmp/.gitkeep file has been removed and replaced with a .gitignore file that ignores all contents (*) except itself (!.gitignore)
  • Updated root .gitignore: Modified .deepwork/.gitignore to track tmp/.gitignore instead of tmp/.gitkeep
  • Automated .gitignore creation: Added logic in _serve_mcp() to automatically create the .gitignore file in the tmp directory if it doesn't exist, ensuring the pattern is consistent across all environments

Implementation Details

  • The .gitignore file is created with a clear comment explaining its purpose
  • The creation is idempotent - it only writes the file if it doesn't already exist
  • This approach is more semantically correct than .gitkeep since it explicitly defines what should be ignored rather than relying on a placeholder file

https://claude.ai/code/session_01WMxTN6a4LLkrjc1nGojNeG

claude added 2 commits March 24, 2026 23:10
The MCP server now auto-creates a .gitignore in .deepwork/tmp/ during
startup (serve command), ensuring temporary files never get committed in
user repos. Replaces the old .gitkeep approach with a self-maintaining
.gitignore that ignores everything except itself.

https://claude.ai/code/session_01WMxTN6a4LLkrjc1nGojNeG
@nhorton nhorton merged commit 28b19a2 into main Mar 25, 2026
5 checks passed
@nhorton nhorton deleted the claude/add-deepwork-gitignore-V9lOS branch March 25, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants