r/gitlab • • 4d ago

meta .gitignore everything by default

https://packagemain.tech/p/gitignore-everything-by-default
19 Upvotes

11 comments sorted by

8

u/Torutofu_Raeva 4d 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

4

u/MarauderXtreme 3d 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?

0

u/adam-moss 3d ago

Because not all users have that?

1

u/MarauderXtreme 3d 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 .gitignore but 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 .gitignore and 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 3d 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

u/yankdevil 4d ago

That's what I do with my vcsh repos.

1

u/chisui 3d ago

Nice, now adding a new file creates a merge conflict.

1

u/adam-moss 3d ago

What makes you think that?

1

u/chisui 3d ago

If two contributers want to both add new files that are not covered by the current .gitignore they both have to edit it causing a merge conflict.

1

u/adam-moss 3d ago

That wouldn't normally cause a merge conflict

1

u/papaJons8080 3d ago

interesting. theres also something called the git excludes but it isnt distributable to the team, since its local only