git - Xcode 10 Git 如何更新 .gitignore 以忽略与 cocoapods 相关的新项目文件?

标签 git cocoapods gitignore xcode10

我设置了一个 .gitignore 来忽略 cocoa pod 相关文件。不过,我为 Xcode 10 项目执行了新的 pod install,以修复不相关的问题,并发现源代码管理中添加了许多与 pod 相关的新文件。这与使用 Xcode 10 有关吗?

如何更新我的 .gitignore 文件以忽略使用 Xcode 10 项目格式添加的新文件/文件夹类型(如果有)?

enter image description here

最佳答案

Xcode 10 中的所有内容都是 Xcode 9.3 和 Xcode 9.4 中所没有的。因此,现在的多项目 .gitignore 文件可能只是:

# Ignore macOS Finder user-related files
.DS_Store

# Ignore Xcode user-related files
xcuserdata/

# Ignore AppCode user-related files
.idea/

# Ignore CocoaPods installed files
Pods/

# Ignore Carthage installed files
Carthage/

如果您不想想要忽略文件,请使用!语法:

# I want to keep that file for some reason (not recommended)
!Pods/Pods.xcodeproj/project.pbxproj

一些流行的引用.gitignore,但慢慢变旧(免责声明:我已经 promise 了这些):

关于git - Xcode 10 Git 如何更新 .gitignore 以忽略与 cocoapods 相关的新项目文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52235034/

相关文章:

xcode - 导入 Alamofire 3.4 - 没有这样的模块 'Alamofire'

ios - ld : symbol(s) not found for architecture x86_64 with Facebook and Parse

git - create-react-app git 推送 node_modules

git - Visual Studio 忽略 gitIgnore 文件中的 *.jfm 条目

react-native - 为什么我们不 gitignore ios/and android/in react-native

Git 提交不会覆盖 git blame 中的原始作者

git - 更改 git 中的分支会导致更改的文件

linux - 双重引导Linux和Windows,尊重git工作流程的最佳方法?

ios - 更新后无法使用cocoapods

ios - 使用 Cocoapods 更新后找不到 Parse/Parse.h 文件