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 tool, GitHub, 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 packages , don'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 小时前
《从像素到身份:Flutter如何打通社交应用人脸识别的技术闭环》
flutter
进击的CJR3 小时前
MySQL 8.0 OCP 英文题库解析(三)
android·mysql·开闭原则
Mckay886 小时前
android studio导入项目
android·ide·android studio
是店小二呀8 小时前
【优选算法 | 字符串】字符串模拟题精选:思维+实现解析
android·c++·算法
百锦再9 小时前
MK米客方德SD NAND:无人机存储的高效解决方案
人工智能·python·django·sqlite·android studio·无人机·数据库开发
奔跑吧 android9 小时前
【android bluetooth 协议分析 12】【A2DP详解 1】【车机侧蓝牙音乐免切源介绍】
android·bluetooth·bt·gd·a2dpsink·免切源·aosp14
飞猿_SIR10 小时前
Android Exoplayer多路不同时长音视频混合播放
android·音视频
前端懒猫11 小时前
android实现USB通讯
android
jiet_h11 小时前
Android锁
android
周胡杰20 小时前
鸿蒙接入flutter环境变量配置windows-命令行或者手动配置-到项目的创建-运行demo项目
javascript·windows·flutter·华为·harmonyos·鸿蒙·鸿蒙系统