7 ms·
- or you could stop scratching your head so hard and actually use the gitignore templates for every programming language officially recommended by github itself
by vivzkestrel 11d ago
- or you could stop scratching your head so hard and actually use the gitignore templates for every programming language officially recommended by github itself
- https://github.com/github/gitignore https://github.com/github/gitignore
- funny how I did not see a single comment talk about this
- piker 11d agoBecause it's insufficient? https://github.com/github/gitignore/blob/main/Rust.gitignore https://github.com/github/gitignore/blob/main/Rust.gitignore for example still falls victim to basically all of the issues specifically called out.
- aleqs 11d agoI use alint [0][1] to define and enforce rules about files/globs that should or shouldn't be committed, among other things. You can configure it run as a pre-commit hook or in CI. (disclaimer - this is my own tool) [0] https://github.com/asamarts/alint https://github.com/asamarts/alint [1] https://alint.org/docs/rules/git-hygiene/git_no_denied_paths/ https://alint.org/docs/rules/git-hygiene/git_no_denied_paths...
- zarlss43 11d agoThese do not include os generated files like his first example, .DS_Store. I do use the templates, but I have a gist that I add to every project of os generated files that may work themselves in.
- adammarples 11d agoJust have a global, personal gitignore in your home folder to cover them
- bloomers 11d agoIt's a good practice to ignore OS specific files in user level gitignore but I think that putting it (redundantly for some of us) in repo is a good practice. Some people don't maintain their own user ignores and might accidentally commit to shared repository. It's clearly fault of commiter and reviewer but let's just save ourselves stress and put those records in the .gitignore of the repo.
- brewmarche 10d agohttps://github.com/github/gitignore/blob/main/Global/macOS.gitignore https://github.com/github/gitignore/blob/main/Global/macOS.g...
- 13415 11d agoIn my experience these templates don't cover enough and are always faulty. Not only that, most real-world projects use many different programming languages and markup languages.
- buzzy_hacker 11d agoI like https://www.toptal.com/developers/gitignore https://www.toptal.com/developers/gitignore because I can mix programming language files with OS ones
- zelphirkalt 11d agoI don't like them, because they contain all sort of crap, that never even enters my projects, but they don't include things they should include, like the silly ".vscode" folder so many people commit without thinking. Also usually using these templates one avoids thinking and knowing what is ignored, until one accidentally commits something special to the project and boom, creating a huge hassle.
- brewmarche 10d agoBut they do: https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore https://github.com/github/gitignore/blob/main/Global/VisualS... You need to merge the relevant ignore files to create one specific for you, so if you use VSCode on macOS VisualStudioCode.gitignore (e.g., .vscode) + macOS.gitignore (e.g., .DS_Store). There are files for other OSs and editors as well. Technically their README says that the Global folder is intended for user-specific ignore files. But you can still use them for the repo .gitignore. There is also this API which you can curl: https://gitignore.io/api/macos,vscode https://gitignore.io/api/macos,vscode Some of the templates seem to be identical, but I think they are not in sync.