Which file tells Git to ignore certain untracked files?

.gitignore
.gitconfig
.gitattributes

How do you define a global ignore file?

git ignore --global ~/.gitignore_global
git config --global core.excludesFile ~/.gitignore_global
git config --global core.ignoreFile ~/.gitignore_global

Why run git rm -r --cached . after adding patterns to .gitignore?

To remove already-tracked files from the index so ignores take effect
To delete files permanently from disk
To reset the repository

Which command previews which untracked files would be removed by git clean?

git clean -fd
git clean -nd
git clean -ad

Which pattern ignores all log files in any folder?

logs/*.log
*.log
/**/.log