It’s not that bad if your project just has a few folders that you reinclude, which I’ve at times done for a few different reasons, but it’s definitely not worth being dogmatic about.
A few years ago, I would have disagreed. But in the age of agentic engineering, I feel like it makes much more sense to .gitignore everything and then have the agent manually add things.
Put it this way: in the past, .gitignore everything would mean having to manually add every new file and folder, which would be a pain in the ass. But agents take that pain away since they can add whatever files they work on automatically. So there’s no longer a real reason not to .gitignore everything.
The agent will only check in the files it needs to change.
Powerbi desktop loves to touch hundreds of files when running in project folder mode. It might show a meaningless change at the end of the files, and I've even seen it simply add a newline at the end. Claude only commits the files it knows it's touched and, thanks to rules we shouldn't have had to add, checking there are no passwords in them.
12
u/waterkip detached HEAD 1h ago
How about no?
6
u/wa11ar00 1h ago
I do this with .dockerignore, because there is only a small number of build and project artifacts that should be containerized.
For git however, majority of files in your project directory usually should be tracked by git. Then you exclude cache, env, etc.
For files like
.DS_Store, I'd recommend adding to~/.gitignoreand settinggit config --global core.excludesfile ~/.gitignore.4
u/keesbeemsterkaas 51m ago
I think this is a solution to a problem I've never had
-6
u/unndunn 1h ago edited 48m ago
A few years ago, I would have disagreed. But in the age of agentic engineering, I feel like it makes much more sense to .gitignore everything and then have the agent manually add things.