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

标签 ios git gitignore privacy

我发现了有关在 Android 应用程序中忽略什么的问题以及有关忽略 cocoapods 的问题。不过,我问的一般是 iOS 项目。

我有一个 iOS 应用程序可以显示 AdMob 提供的广告并使用 Firebase 查看我的应用程序的分析。它使用一些椰子。

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

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

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

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

隐私信息包括

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

隐私信息不包括:

  • 我的真名
  • 我的年龄

最佳答案

我建议您看一下人们创建存储库时 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

关于ios - 我应该在 iOS 应用程序的 git 存储库中忽略哪些文件/文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37479924/

相关文章:

ios - 让流与 AVAudioPlayer 一起工作

ios - 使用核心图更新图形的特定部分?

windows - 在 Windows 上忽略 Git 存储库中的目录

Git:将提交的一部分应用到另一个分支

git - 你如何让 git bisect 忽略 merge 的分支?

git - 为什么有不同的方法在 .gitignore 中指定目录

git - 找出哪些文件是版本控制的,现在匹配当前的 .gitignore

iOS 本地声明隐藏实例变量 + NSCFString objectForKeyedSubscript 无法识别的选择器发送到实例

ios - 循环遍历 UIScrollView 并设置 UImageView

git - 无法 git fetch - 对等方重置连接