在上传到github之前,我应该隐藏iOS Xcode项目中的哪些文件?

时间:2015-07-23 17:19:00

标签: ios swift github

Ruby on Rails中,我知道有config/secrets.yml个文件我不应该上传到github

iOS应用中是否有相应的内容?我想将我的应用程序上传到github,然后再将其提交到Apple应用程序商店,并且我不想意外地分享任何秘密密钥或任何其他应该保密的密钥。

2 个答案:

答案 0 :(得分:2)

GitHub维护一个包含多种语言的.gitignore推荐标准的公共项目:https://github.com/github/gitignore

对于XCode,这是file looks

的方式
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
#Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

答案 1 :(得分:1)

这是我在一些项目中用于.gitignore文件的内容:

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

# Exclude OS X folder attributes
.DS_Store
.svn

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

我认为这可以处理Xcode的用户特定本地项目文件和OS X临时文件,同时保留项目直接从存储库构建所需的一切。