The .gitignore file lists the patterns of files and folders that Git must ignore: dependencies, compiled files, logs, secrets. It avoids versioning useless or sensitive files. It only has an effect on files that are not yet tracked.
Example
node_modules/ .env *.log