3 ms·
This is bad advice. The repo’s ignore file is there so that other people (without certain domain knowledge) don’t accidentally commit undesirable files, includi
by ghusto 2y ago
This is bad advice. The repo’s ignore file is there so that other people (without certain domain knowledge) don’t accidentally commit undesirable files, including directories containing sensitive information (which get generated by some tools like Terraform).
Use the repo’s ignore, not your own.
- default-kramer 2y agoExactly, sometimes it takes me some minutes of research to determine whether a certain file should be ignored or not. In that situation, it's very appropriate to put that in the repo's gitignore, preferably with comments explaining why the pattern is included/excluded.
- eddiejaoude 2y agogood point, comments are super important
- eddiejaoude 2y agoI don't think you read the article, there is a video at the end if you prefer. Yes we should use git ignore for the repo specific items, so if the repo has terraform it should ignore generated files - but not desktop tools people use as we all use different dev tools
- default-kramer 2y ago> Examples of folders included in the git ignore file are generated files like “.next” from NextJS or “test-results” from Playwright. These will be generated for every developer on the project regardless of their OS, IDE etc. > Yes I am saying this is wrong… (let me know if you agree/disagree below) I didn't realize that the first paragraph is saying "This is good"; I thought the second paragraph was saying that the first paragraph is bad.
- eddiejaoude 2y agooh sorry for the confusion! I do think we need both git ignores, but to be used appropriately. System global .gitignore solves a problem specific to that developer Repo .gitignore solves a problem for the project (and every developer)