git - 什么不应该包含在 flutter 应用程序的公共(public) repo 中

标签 git flutter gitignore

我刚开始使用 Flutter。我在 flutter 中制作了一个应用程序。现在,我想把这个应用程序放在我的 github 公共(public)仓库中。我的问题是我应该在 .gitignore 文件中放入什么?

我的意思是,什么不应该包含在 flutter 应用程序的公共(public) repo 中?

最佳答案

.gitignore 来自新创建的 flutter 应用的文件内容。这些是要从 git 中排除的文件。

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

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

# Visual Studio Code related
.vscode/

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

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

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

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

关于git - 什么不应该包含在 flutter 应用程序的公共(public) repo 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55204687/

相关文章:

android - Visual Studio Code(Flutter) 中的 build.gradle 错误

git - 我们应该(git/版本控制)跟踪 Firebase 托管的 .firebase 文件夹吗?

android - git .gitignore 不忽略以前跟踪的文件

git - 建筑机器人 : How to know the branch that triggered the build?

git - 找出本地分支正在跟踪哪个远程分支

c++ - 使用 Visual Studio 编译 Cling

git - 跨所有分支的相同全局远程 gitignore 文件

Git Diff - 如何还原选定的行或 block

flutter - 如何将数据从方法_callLogs传递到正文并进行打印?

git - .gitignore : track a single file in an ignored directory