Git .gitignore
A .gitignore file lists files and folders that Git should not track, like log files, build output or secrets.
Put it in the top folder of your repository and commit it. Each line is a pattern: a file name, a folder ending in /, or a wildcard like *.log. It does not affect files Git already tracks.
Ignore a log file and a folder
error.log
temp/
Ignored files are hidden from git status
error.log and temp/ exist, but Git does not list them:
git status --short
?? .gitignore
git check-ignore -v error.log
.gitignore:1:error.log error.log