Xcode 6 gitignore文件应包含哪些内容?

时间:2013-09-22 01:27:28

标签: ios iphone xcode git

Xcode 6的典型.gitignore应包含哪些内容?

另外,有关Xcode 5中引入的xccheckout的信息,请参阅here

3 个答案:

答案 0 :(得分: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

我相信GitHub默认设置了所有存储库。

2)

另一个答案是有website called "gitignore.io",它根据https://github.com/github/gitignore的.gitignore模板生成文件。

答案 1 :(得分:56)

如果您在Xcode 6中从头开始创建一个新项目......不再需要一个长的.gitignore文件,如I pointed out in my last post:Apple优化了标准项目文件和文件夹结构以满足要求对于明确和直接的git提交。如果使用Xcode项目模板创建git存储库,Apple默认也会忽略两种文件模式:

.DS_Store
UserInterfaceState.xcuserstate

他们将它们添加到项目目录中的 .git/info/excludes 文件中。因此,无需在.gitignore中重新忽略它们: - )

.gitignore 文件中唯一包含的内容是

# Exclude personal Xcode user settings
xcuserdata/ 

答案 2 :(得分:6)

请参阅Github的Xcode.gitignore文件,以获取要忽略的Xcode文件的更新列表。

相关问题