When making sure that iPhone project could be installed as an exact copy into a brand new computer via version control (git), I just realized that .gitignore
Command-Shift-. and the hidden files will appear, including .gitignore. .gitignore file and press the Add button.This works in any app, not just Xcode. It's an obscure feature of NSOpenPanel.
This solution didn't work for me in XCode 8.0 and El Capitan.
I opened a terminal and typed:
defaults write com.apple.finder AppleShowAllFiles YES
cd ../PATH_TO_GIT_ROOT
touch .gitignore
Then relaunched Finder and my .gitignore file was visible. Edit per .gitignore documentation