Search code examples
swiftxcodegitgitignore

Does Xcode 11 and its new frameworks like SwiftUI demand changes to .gitignore?


I peaked into the .gitignore file that was in the SwiftUI example projects and found this. Should I add it to the current swift,macos template I pull from git? I'm not so concerned as I am curious whether it's superfluous.

I have copied and pasted it under the templates ##Various Settings xcuserdata/


This is what I copied: /.xcodeproj/project.xcworkspace/ !/*.xcodeproj/project.xcworkspace/xcshareddata

/.xcodeproj/project.xcworkspace/xcshareddata/ !/*.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

/.playground/playground.xcworkspace/ !/*.playground/playground.xcworkspace/xcshareddata

/.playground/playground.xcworkspace/xcshareddata/ !/*.playground/playground.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings


Solution

  • Nope. .gitignore tells git which files (or patterns) it should ignore. It's usually used to avoid committing transient files from your working directory.

    You can find an official gitignore example for Swift here. You can use it, by default ;)

    I also recommend reading about git: What is git