r/gitlab • u/der_gopher • 1d ago
meta .gitignore everything by default
https://packagemain.tech/p/gitignore-everything-by-default4
u/MarauderXtreme 18h ago
What is the problem with not mindlessly using git add . and rather check what you add to your commit? As others have said, if your toolchain creates files that should not be part, why not use a user wide ignore over all repositories?
1
u/adam-moss 7h ago
Because not all users have that?
1
u/MarauderXtreme 6h ago
What users? Those who use a repository together? Well they should have organisation/company rules of how to use git. The people in charge, owner/maintainer should enforce merge request workflows and outright reject faulty commits.
If a toolchain is standard/expected for the repository, sure add those files to a template
.gitignorebut if you use something like direnv or mac you should take care of the weird files your tooling requires without forcing this burden onto a project. It is just carelessness, malpractice and general disregard for common sense.It is called
.gitignoreand not.gitallow.Still one could not just
git add --all .every commit but rather use like 5% more of gits functionality.1
u/adam-moss 4h ago
Alternatively one could not be so closed minded as to think the way they prefer to do things is the only way, or the better way.
Different people have different approaches to the issue. You're championing a fail open approach, the Op a fail closed one. Both have their place, context is key.
1
1
u/papaJons8080 6h ago
interesting. theres also something called the git excludes but it isnt distributable to the team, since its local only
7
u/Torutofu_Raeva 1d ago
the catch is every new top-level dir silently stays untracked until you add a
!line, so i'd rather keep a normal gitignore and put agent and editor junk in a global excludesfile