简体   繁体   English

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

[英]What files/folders should I ignore in a git repository of an iOS app?

I have found questions about what to ignore in an Android app and questions regarding ignoring of cocoapods. 我发现了有关在Android应用程序中忽略什么的问题以及有关忽略cocoapods的问题。 However, I am asking about an iOS project generally. 但是,我一般是在问一个iOS项目。

I have an iOS app that displays ads provided by AdMob and uses Firebase to see the analytics of my app. 我有一个iOS应用,可显示AdMob提供的广告,并使用Firebase查看我的应用的分析。 And it uses a few cocoapods. 它使用了一些椰壳足纲。

From one of my previous questions, I learnt that my ad unit id is a private thing. 从之前的一个问题中,我了解到我的广告单元ID是不公开的。 Therefore, I put my ad unit id in a separate file and ignored it: 因此,我将广告单元ID放在一个单独的文件中,并忽略了它:

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

I think this way people will never know my ad unit ID. 我认为这样一来,人们将永远不会知道我的广告单元ID。

But what about other stuff? 但是其他东西呢? Do the files generated by cocoapods contain some of my private information? cocoapods生成的文件是否包含我的一些私人信息? Does info.plist file contain my private stuff as well? info.plist文件也包含我的私人物品吗? Also, when I was putting Firebase into my app, I downloaded a GoogleService-Info.plist. 另外,当我将Firebase放入应用程序时,我下载了GoogleService-Info.plist。 Should I ignore it as well? 我也应该忽略它吗? What things should I ignore? 我应该忽略什么?

Private information includes 私人信息包括

  • My email 我的电子邮件
  • Home address 家庭地址
  • My phone number 我的电话号码
  • Ad Unit ID 广告单元编号
  • My passwords 我的密码
  • Other things that, when disclosed, will cause adverse effect on my life, such as a loss of money/income or being in danger. 披露时可能会对我的生活造成不利影响的其他事物,例如金钱/收入损失或处于危险之中。 For example, if I disclose my Ad Unit ID, people will spam ads and my account will be banned. 例如,如果我披露我的广告单元ID,则人们将发送垃圾广告,并且我的帐户将被禁止。

Private Information does not include : 私人信息不包括

  • My real name 我的真名
  • My age 我的年龄

I'd suggest you take a look at what GitHub uses for when people create repos. 我建议您看看人们创建回购协议时GitHub的用途。 You can find all their examples here . 您可以在此处找到所有示例。 These ones will be of particular interest to you: 这些是您特别感兴趣的:

Adding the templates below incase the links break in the future. 在下面添加模板,以防将来链接断开。

For Xcode Projects in General: 对于一般的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

For Objective-C Projects: 对于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/

For Swift Projects: 对于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

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM