Mic*_*ann 276
1)
最简单的答案是我的看起来像这样:
# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
# Pods - for those of you who use CocoaPods
Pods
Run Code Online (Sandbox Code Playgroud)
我认为这是相同的.gitignore GitHub默认设置所有的存储库.
2)
另一个答案是,有一个名为"gitignore.io"的网站,它根据https://github.com/github/gitignore上的.gitignore模板生成文件.
cro*_*ode 56
如果你在Xcode 6中从头开始创建一个新项目...就像我在上一篇文章中指出的那样,不再需要一个很长的.gitignore文件:Apple优化了标准项目文件和文件夹结构,以满足明确而直接的git提交.如果使用Xcode项目模板创建git存储库,Apple默认也会忽略两种文件模式:
.DS_Store
UserInterfaceState.xcuserstate
Run Code Online (Sandbox Code Playgroud)
他们将它们添加到.git/info/excludes
项目目录中的文件中.因此,无需在.gitignore中重新忽略它们:-)
我总是在.gitignore
文件中包含的唯一内容是
# Exclude personal Xcode user settings
xcuserdata/
Run Code Online (Sandbox Code Playgroud)