What belongs in a `.gitignore` and what does not?
BeginnerConceptHooks, submodules, LFS and signing
Answer
Ignore generated and local files: build output, dependencies (node_modules/), virtualenvs, IDE settings, logs and .env. Do not rely on it for secrets already committed. Commit lock files, and keep personal editor patterns in your global ignore.
git config --global core.excludesFile ~/.gitignore_global
More on Hooks, submodules, LFS and signing
What are Git hooks and where do they live?BeginnerHow do you share hooks with a team, given `.git/hooks` is not committed?IntermediateWhat does the `commit-msg` hook receive and what is it good for?IntermediateWhat do `pre-receive` and `update` hooks do and how do they differ?AdvancedWhat is a Git submodule?BeginnerWhy do submodules confuse people and what are the common pitfalls?Intermediate