🔀.gitignore
Also known as gitignore, .gitignore File, Git Ignore
A file that tells Git what to leave out, like keys and build files.
Think of it like
Think of it like a do not pack list for a trip. Anything on it stays behind.
Example
Jack adds .env to his .gitignore. Now the file with his passwords can never be committed by accident.
Why it matters
It keeps passwords out of shared history. It also keeps the repo small and clean.
Definition
Example code
console
$ cat .gitignore
node_modules/
.envCommon mistake
Key takeaways
- 1A list of skips. Names and patterns Git ignores.
- 2Keep secrets out. Passwords never reach the history.
- 3Before, not after. It cannot hide a file already tracked.