简体   繁体   English

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

[英]Which files in my iOS Xcode project should I hide before uploading to github?

In Ruby on Rails , I know there's a config/secrets.yml file which I shouldn't upload to github . Ruby on Rails ,我知道有一个config/secrets.yml文件不应该上传到github

Is there anything equivalent in an iOS app? iOS应用程序中有什么等效功能吗? I'm thinking about uploading my app to github before submitting it to the Apple app store, and I don't want to accidentally share any secret keys or anything else that should remain private. 我正在考虑在将其应用程序提交到Apple应用程序商店之前将其上传到github ,并且我不想意外地共享任何秘密密钥或任何其他应该保持私有的密钥。

GitHub maintains a public project with the .gitignore recommendations for several languages: https://github.com/github/gitignore GitHub维护着一个公共项目,其中包含针对多种语言的.gitignore建议: https : //github.com/github/gitignore

For XCode this is how the file looks : 对于XCode,这是文件的外观

# 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

This is what I've been using for a .gitignore file in a few projects: 这是我在一些项目中一直使用的.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

I think that handles Xcode's user-specific local project files and OS X temp files, while preserving everything you need for a project to build straight from the repository. 我认为它可以处理Xcode的用户特定的本地项目文件和OS X临时文件,同时保留您从存储库直接构建项目所需的一切。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 上传到Github时,出于安全目的,我应该从Xcode项目中删除任何内容吗? - Are there any things I should remove from an Xcode project for security purposes when uploading to Github? 我应该在xcode项目中将文件添加到哪些目标 - What targets should I be adding my files to in my xcode project 我在我的 ios 项目中添加了一些文件,但它们没有显示在 XCode 项目导航器中 [XCode 13.2] - I added some files in my ios project but they are not showing up in XCode project navigator [ XCode 13.2 ] 我是否需要为现有项目更新Xcode 9.0和IOS 11,但苹果尚未批准该项目? - Do I need to update Xcode 9.0 and IOS 11 for my existing project, which is not approved by apple yet? 为什么我的Xcode知道项目的目录应该有文件? - Why my Xcode know the project's directory should have the files? 我应该在新的Xcode项目中使用autolayout吗? - Should I use autolayout in my new Xcode project? 将iOS xcode文件提交到Github的一般规则 - General Rules for commiting iOS xcode files to Github 由于我的 flutter 应用程序中有两个主要文件,我该如何选择要从 xcode IOS 存档的程序? - how do i choose which program to archive from xcode IOS as i have two main files in my flutter app? 我应该将 www 文件夹用于cordova iOS 项目吗? - Which should I use the www folder for cordova iOS project? 如何知道我的XCode将部署到哪些iOS版本? - How can I tell which iOS versions my XCode will deploy to?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM