iPhone(Xcode)项目的“.gitignore”文件的“标准”内容是什么?

23

什么是在 iPhone(Xcode)项目中被认为是 '.gitignore' 文件的“标准”内容?

PS:不确定是否需要将此设为 CW。


可能是Git忽略Xcode项目的文件的重复问题。 - Adam
3个回答

34
build/
.DS_Store
**/*.pbxuser
*.mode2v3
*.mode1v3
**/*.perspectivev*

这是一个不错的开始。

根据Dave的建议进行了更新。


1
+1 我通常会使用 **/*.pbxuser,我还会添加 **/*.perspectivev* - Dave DeLong

10

在Xcode 4.2中,您还应该排除xcworkspacexcuserdata。因此,以下是iOS项目应忽略的完整列表。

# Exclude the build directory
build/*

# Exclude temp nibs and swap files
*~.nib
*.swp

# Exclude OS X folder attributes
.DS_Store

# Exclude user-specific XCode 3 and 4 files
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
*.xcworkspace
xcuserdata

1
现在xcworkspace不再被忽略了。https://github.com/github/gitignore/blob/master/Objective-C.gitignore - Raphael Oliveira

6

根据今天的GitHubgitignore项目:

# 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/

来源: https://github.com/github/gitignore/blob/master/Objective-C.gitignore

这是一个Objective-C的.gitignore文件示例,用于Git版本控制系统中。该文件列出了应该忽略的文件和目录,以便在提交代码时不包括不必要的文件。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接