At my current job, while reorganizing our company's root git monorepo, we decided to adopt a .gitignore allowlist pattern. I had previously experimented with this approach on raconn, but this monorepo is significantly larger. The complexity required a dedicated script to generate the .gitignore file effectively. Why use an allowlist? Pros: Pure state: You know exactly what is being tracked and must explicitly write tracking patterns. No unintended files: Prevents accidental commits of secrets, large binaries, or build artifacts. Cons: Noise: Spurious files aren't listed as untracked, making them harder to spot. Maintenance: The .gitignore must be regenerated. Git gotchas By default, every line in a .gitignore file is a pattern to exclude. Files matching these patterns cannot be added to version control easily and do not appear as untracked in git status. The Git documentation states the following regarding negation: An optional prefix "!" which negates the pattern; any matching file…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.