Glob patterns explained (and why .gitignore behaves that way)

How glob patterns work: star vs double star, question marks, character classes, brace expansion, and the gitignore rules that trip everyone up.