gitignore can actually refer to any of several files:
$HOME/.config/git/ignore- applies to all Git projects for this user
$GIT_DIR/info/exclude- not sure what this does
.gitignore- the file ".gitignore" in the local project folder
- any file specified by
core.excludesfilein the user’s
Each of these has uses specific to them; see the manpage for more information.