Android Studio 使用小记2 Flutter提交SVN时需要忽略哪些文件

今天上午发了一篇使用SVN的小记,在解决问题的过程中,发现不少同学在使用Android Studio进行Flutter应用开发时,对需要忽略哪些文件(不提交到SVN协同)不是很明确,对于这个问题,Flutter官方有明确的说明,可通过下面的网址进入了解:

https://dart.dev/guides/libraries/private-files 

What not to commit

When you put Dart source code in a repository—using the pub toolGitHub, or another source code management system—don’t include most of the files that your IDE or code editor, the pub tool, and other tools generate.

info Note: Except where noted, this page discusses only source code repositories, not app deployment. Some files that you wouldn’t normally put in a repository are useful or essential when you deploy an app.

The rules

Don’t commit the following files and directories created by pub:

.dart_tool/
build/
pubspec.lock  # Except for application packages

Don’t commit the API documentation directory created by dart doc:

doc/api/

Don’t commit files and directories created by other development environments. For example, if your development environment creates any of the following files, consider putting them in a global ignore file:

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

# Mac
.DS_Store

For more details, read on.

Details

As a rule, commit only the files that people need to use your package or source code repository. Including additional files is unnecessary, could be counterproductive, and might have security implications if you expose details about your machine’s setup. In many source code repositories, the common practice is not to commit generated files, at all.

To avoid committing files that are specific to your personal workflow or setup, consider using a global ignore file (for example, .gitignore_global).

When you use pub from within a Git repo, pub ignores the same files that Git does. For example, if you run pub publish from a Git repo that has a .gitignore file containing keys.txt, then your published package won’t contain the keys.txt file.

For more information on .gitignore files, see the GitHub help page Ignoring files.

.dart_tool/

The .dart_tool/ directory contains files used by various Dart tools.

pubspec.lock

The pubspec.lock file is a special case, similar to Ruby’s Gemfile.lock.

For regular packagesdon’t commit the pubspec.lock file. Regenerating the pubspec.lock file lets you test your package against the latest compatible versions of its dependencies.

For application packages, we recommend that you commit the pubspec.lock file. Versioning the pubspec.lock file ensures changes to transitive dependencies are explicit. Each time the dependencies change due to dart pub upgrade or a change in pubspec.yaml the difference will be apparent in the lock file.

相关推荐

  1. Git提交忽略指定文件

    2024-01-31 07:12:03       31 阅读
  2. SVN忽略文件的两种方式

    2024-01-31 07:12:03       38 阅读
  3. VS项目 git 提交忽略文件配置

    2024-01-31 07:12:03       30 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-31 07:12:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-31 07:12:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-31 07:12:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-31 07:12:03       18 阅读

热门阅读

  1. 深入了解Flutter中的Sliver:介绍与使用场景

    2024-01-31 07:12:03       38 阅读
  2. 网站分享(实用)

    2024-01-31 07:12:03       43 阅读
  3. NetCore iText7 根据PDF模板 导出PDF

    2024-01-31 07:12:03       36 阅读
  4. P8655 [蓝桥杯 2017 国 B] 发现环

    2024-01-31 07:12:03       38 阅读
  5. 最大公约数(左右区间问题)

    2024-01-31 07:12:03       33 阅读
  6. 深入理解并测试HttpResponse —— 关键知识和实践

    2024-01-31 07:12:03       29 阅读
  7. STM32——点灯

    2024-01-31 07:12:03       32 阅读
  8. vue中nextTick()

    2024-01-31 07:12:03       34 阅读
  9. Vue2:请求接口的两种方式axios和vue-resource

    2024-01-31 07:12:03       38 阅读
  10. [GN] DP学习笔记板子

    2024-01-31 07:12:03       32 阅读