Scratchpad
Keep one-off scripts, experiments, and debugging artifacts in a single scratch directory outside the project’s source tree:
-
Use the session-scoped scratch or temp directory your runtime provides, if it has one.
-
Otherwise create one outside the repository and note its path for the rest of the session:
scratch="$(mktemp -d)" -
Write every temporary file of the session to that same directory. Reference project files by path from there instead of copying scratch files into the repository.
-
When the experiment or debugging session ends, delete the files you created (for a
mktemp -ddirectory,rm -rf "$scratch").
Completion criteria
git statusshows no files created by the experiment.- The scratch directory is deleted, or it is the runtime’s own session directory.