r/gitlab • u/der_gopher • Sep 05 '26
.gitignore everything by default
https://packagemain.tech/p/gitignore-everything-by-defaultwhat do you think of this approach?
9
u/kerrizor Sep 05 '26
Interesting. I’d need to chew on it a bit, but I can see the benefit.. this clearly comes from a place of “show me where you have scars from git”.
3
2
u/eltear1 Sep 05 '26
That could be valid in a git repo sued by only one or few people. For shared repos , too many people will not understand why they can't push and loose rime to search for the cause . Well, now with AI is kinda not so much useful anyway if AI itself is pushing...
0
0
u/adam-moss Sep 05 '26
/shrug AI understands the pattern perfectly fine, I have no issues using it with Claude, kiro, or codex.
2
u/TheSodesa Sep 05 '26
I use this approach all the time. Especially useful when you are working with less experienced Git users.
1
1
1
1
u/schmurfy2 Sep 07 '26
Don't let your agent create commits and do it yourself, ignore what should not be commited while reviewing the code.
I know it's a crazy idea.
0
u/adam-moss Sep 05 '26
We consciously chose to use this approach, it's a much more secure default and prevents a lot of mishaps. I understand some people think it strange, but default-deny should almost always be your starting position.
0
u/Feeling-Bad757 Sep 06 '26 edited Sep 06 '26
This is the way
Very useful for greenfields. Forces devs to think carefully about adding complexity or dependencies, and needs a peer review to update.
2
Sep 05 '26
[removed] — view removed comment
-3
u/No-Aioli-4656 Sep 05 '26
Agreed. Tell me you are a solo dev in a sentence…
1
u/adam-moss Sep 05 '26
Unnecessary don't you think?
0
u/No-Aioli-4656 Sep 05 '26 edited Sep 05 '26
No? I’ve never worked on teams where git was declaratory.
You local exclude that shiz.
And on a repo where anything more than 60hours of effort exists, the reverse is going to get to that ~200 line mark(that the article complains about.)
OP doesnt use this on teams. It doesn’t play well with others or big codebases. That’s fine.
1
u/adam-moss Sep 06 '26
Ok, so just because you haven't doesn't mean it isn't. It works perfectly fine in teams and big codebases.
10
u/jirka642 Sep 05 '26
Stupid idea. You would lose so much work like that.
Also, unless you are a complete beginner, you should always know what you are committing. So, this is not an issue in the first place.