How to add .gitignore file into Xcode project
When the open panel is showing, press Command-Shift-. and the hidden files will appear, including .gitignore. Select the .gitignore file and press the Add button. This works in any app, not just Xcode. It’s an obscure feature of NSOpenPanel.