Two Git ignore files nobody told me about
href=https://github.com/mihai-dinculescu/mihai.dinculescu.dev/tree/main/content/posts/two-git-ignore-files-nobody-told-me-about.md target=_blank>Source Code:: claude-code git
以下正文同步自 Hacker News,版权归原站所有,已转换为易读排版。
href=https://github.com/mihai-dinculescu/mihai.dinculescu.dev/tree/main/content/posts/two-git-ignore-files-nobody-told-me-about.md target=_blank>Source Code:: claude-code git
One of my many bad habits is carrying untracked files around in the repositories I work on.I did learn, some time ago, that those files must never contain secrets, because sooner or later they get committed by mistake. I learned it the easy way, by watching a colleague learn it the hard way: furiously rewriting history to cover his tracks, then rotating cloud credentials in a panic.These days the untracked files are harmless. Random markdown notes and, more often than not, agent plans. I haven't started committing those yet. They go stale fast, and I'm not convinced they're worth the effort.So why put up with a permanently dirty working tree? Because until very recently, the only way I knew to ignore a file in git was to add it to .gitignore. And .gitignore gets committed. That's exactly right for things everyone cloning the repo will have, like the classic .env, but pushing the silly filename I picked for my private notes to a remote repository feels unclean. So I did nothing, and the untracked files piled up. About ten plans at the last count.But then Claude asked, out of the blue, something along the lines of
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。