-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean .gitignore files #30
Comments
Only project-specific files should go in the .gitignore: See coderbyheart/first-principles#30
Sounds like a .gitinclude might make more sense. When you |
Well, if you encourage developers to use
Will tell git to ignore all files except those with the I think however that this is already a built-in feature of git: it only tracks what you tell it to track. |
The controversial tweet for this: https://coderbyheart.com/twitter/status/1212980450861420544
A
.gitignore
in a project should only cover artifacts caused by the contained source code, not those caused by the personal choice of editor and/or environment of a developer. Use a global git ignore file for that.Yes, you can solve it also with a well maintained
.gitignore
file that covers everything in all projects but this can get quite extensive to cover all cases.I consider it noise if entries are in the
.gitignore
that have no relation to the specific project: I want a clean.gitignore
file.Maintaining a global
.gitignore
file for your personal setup also has the advantage that it affects all existing and future projects on your machine, thus eliminating the possibility of accidentally committing those files. Otherwise you would need to remember to add your IDE files to EVERY projects.gitignore
.Additionally, changes to the
.gitignore
of a project are not free: they trigger CI runs, releases, reviews. Having people constantly add their favourite rules creates noise. I don't want that.Having a huge catch-all
.gitignore
is no solution either, it will only cover known files. Additions trigger noise.Adding files to a git repository is a deliberate action, if developers add files that do not belong to a feature or change they need to be better educated about it.
If this is done, an accident-preventing-gitignore is no longer needed.
Good example
Bad example
Tip
Have a local folder to put your crap in which won't get accidentally committed
The text was updated successfully, but these errors were encountered: