ios - 为什么 ios/build 文件夹没有包含在 .gitignore 文件中?

标签 ios git flutter gitignore

为什么默认情况下 ios/build 没有包含在 gitignore 中?

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        ios/build/

/.gitignore 文件

# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

/lib/credentials.dart

/ios/.gitignore 文件:

*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3

最佳答案

gitignore 中所述:

If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself.

Otherwise the pattern may also match at any level below the .gitignore level.

一旦您将模式更改为构建/,请不要忘记您还有一个,以验证它是否有效:

git check-ignore -v -- ios/build/aFile

那应该打印 .gitignore 规则行,它会忽略文件夹。

关于ios - 为什么 ios/build 文件夹没有包含在 .gitignore 文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69157866/

相关文章:

ios - 自定义长按手势识别器

ios - 将 NSString 与来自 Parse.com 的 NSArray 进行比较(Obj-c)

objective-c - CGContextStrokePath(context) 崩溃。为什么?

git - pull 请求与 merge 请求

Git:推送时忽略某些提交

flutter - 保持 firesotrore 集合离线可用并在前台同步

iphone - 崩溃 iPad 照片选择器

c++ - 什么是与 Codeblocks C++ 项目一起使用的好 gitignore?

flutter - 如果指定了home属性,则路由表不能包含/的条目

flutter - 改变 InkWell 的速度