Does the .gitignore file belong in the .git folder structure somewhere or in the main source files?
If you want to do it globally, you can use the default path git will search for. Just place it inside a file named "ignore" in the path ~/.config/git
~/.config/git
(so full path for your file is: ~/.config/git/ignore)
~/.config/git/ignore