Make .gitignore ignore itself
- published
- reading time
- 1 minute
I don’t know why it took me so long to realize
that you can create a .gitignore with only an *
in any folder, and then you don’t have to include
that folder’s name in your root .gitignore.
You can even rename the folder without having to
touch anything else.
This is great for quick experiments or an agent scratchpad.
Example:
my-service/
└── .scratch/
├── .gitignore # contains only *
├── prompts/
├── alternative-implementation/
├── benchmark-results/
└── notes.md