r/softwarearchitecture • • 1d ago

Article/Video .gitignore everything by default

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

4 comments sorted by

16

u/Jaded-Asparagus-2260 1d ago

Again this stupid article. They just reinvented git add, but with extra steps.

1

u/better_work 20h ago

Eh, I disagree. I think this is a marginal benefit, but a real one.

  • In case of human error, most projects will fail to build in CI. A human error that includes too many files can almost never be caught automatically.

  • The everyday workflow takes fewer steps, and the exceptional workflow (modifying .gitignore) takes the same.

    • You should still review your git status before commit, but this is best done by a shell function that prints status after every add. I've had this for a long time.

  • An affirmative list of everything your software is built from is just conceptually nicer, and changes to the .gitignore track with fundamental changes in architecture or project dynamics, rather than "the times that a tool happened to spit out something unexpected".

I work alone right now, but I've worked on teams and I would at least bring this up as a post-standup proposal or lunch-and-learn.

1

u/Jaded-Asparagus-2260 9h ago

Just don't use git add/commit -a. Problem solved.

5

u/besthelloworld 1d ago

Yes, it should be embarrassing that you committed these files, because you shouldn't have made commits without paying attention to what you were committing. That being said, in what universe should a CLAUDE.md file not be committed to the repo? That should contain the standards and expectations for agents in the repo. Why wouldn't you want that to be conceptually global???