我应该在iOS应用的git存储库中忽略哪些文件/文件夹?

时间:2016-05-27 09:33:00

标签: ios git gitignore privacy

我发现了一个关于在Android应用中忽略什么的问题以及有关忽略cocoapods的问题。但是,我一般都在询问一个iOS项目。

我有一个iOS应用,可以显示AdMob提供的广告,并使用Firebase查看我的应用的分析。它使用了一些cocoapods。

从我以前的一个问题中,我了解到我的广告单元ID是私有内容。因此,我将广告单元ID放在单独的文件中并忽略它:

// Secret Stuff.swift
let adUnitId = "dianfkebsfiubugb"

我认为这样人们永远不会知道我的广告单元ID。

但其他东西呢? cocoapods生成的文件是否包含我的一些私人信息? info.plist文件是否也包含我的私有内容?此外,当我将Firebase放入我的应用程序时,我下载了一个GoogleService-Info.plist。我也应该忽略它吗?我应该忽略哪些事情?

私人信息包括

  • 我的电子邮件
  • 家庭住址
  • 我的电话号码
  • 广告单元ID
  • 我的密码
  • 其他事项,如果披露,将对我的生活造成不利影响,例如损失金钱/收入或处于危险之中。例如,如果我披露了我的广告单元ID,那么人们就会垃圾广告,我的帐户将被禁止。

私人信息不包括

  • 我的真实姓名
  • 我的年龄

1 个答案:

答案 0 :(得分:10)

我建议您看看GitHub在人们创建回购时使用的内容。您可以找到他们的所有示例here。这些将是您特别感兴趣的:

添加以下模板会使链接在将来中断。

一般的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
*.moved-aside
*.xccheckout
*.xcscmblueprint

对于Objective-C项目:

# 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
*.moved-aside
*.xcuserstate

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

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://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

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/screenshots

#Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

对于Swift项目:

# 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
*.moved-aside
*.xcuserstate

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

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://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

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output