2

I've got a Swift Package I've created that has a .gitignore file and a .swiftlint.yml config file in it. They are in the repo. They are in the directory. I can drag and drop them into Xcode, but they don't appear in Xcode.

If I do command-shift-. in the "Add Files to MyPackage..." dialog box, I can see the hidden files and add them. However, I can't actually see them in the Project Navigator to edit the files. Right now I have to leave Xcode to edit those config files.

How do I show hidden files in Xcode Project Navigator?

mfaani
  • 33,269
  • 19
  • 164
  • 293
Brian
  • 1,675
  • 3
  • 19
  • 29
  • Does this answer your question? [How to add .gitignore file into Xcode project](https://stackoverflow.com/questions/14517440/how-to-add-gitignore-file-into-xcode-project) – timbre timbre Sep 20 '21 at 22:13
  • Hi Kiril, I should have answered your question when I answered AdR. That process made the .gitignore file visible in the Finder, but in XCode I'm still not able to see it. I tried adding the file to XCode again after doing what you described, but it still did not appear in the Project Navigator in XCode. No hidden files starting with a . show up in my project navigator in XCode so I end up having to go outside of XCode to edit them. – Brian Sep 24 '21 at 12:55

1 Answers1

0

open your terminal

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

AdR
  • 572
  • 1
  • 4
  • 13
  • Hi AdR, that made the .gitignore file visible in the Finder, but in XCode I'm still not able to see it. I tried adding the file to XCode again after doing what you described, but it still did not appear in the Project Navigator in XCode. No hidden files starting with a . show up in my project navigator in XCode so I end up having to go outside of XCode to edit them. – Brian Sep 21 '21 at 15:35