dart - 您如何强制“pub get”从 git 获取最新信息?
问题描述
我的 pubspec.yaml 文件中有一个 git 依赖项,如何在 git 存储库中发生新更改时强制更新它?
flutter pub get / pub get
它没有得到最新的,因为它是.pub-cache/git/
有没有办法强制从 pubspec.yaml 中引用的 git repo 更新特定依赖项?
解决方案
在您的pubspec.yaml
中,您可以指定特定的 git 提交:
dependencies:
http2:
git:
url: https://github.com/dart-lang/http2.git
ref: c31df28c3cf076c9aacaed1d77f45b66bb2e01a6
或者,如果您仅在“ref”中指定一个分支:
dependencies:
http2:
git:
url: https://github.com/dart-lang/http2.git
ref: master
您需要强制更新flutter packages upgrade
推荐阅读
- azure-devops - 使用 Rest API 在 Azure DevOps 中创建新用户
- wordpress - 为什么我在尝试访问 localhost/phpmyadmin 时突然收到 Access Forbidden Error 403?
- ruby - 包括来自黄瓜内部 rspec 的共享示例
- database - 在 Firestore 中查询没有映射键的文档
- android - 无论如何要为整个应用程序而不是每个活动处理 onPause() 吗?
- c# - 无法转换 C# .Net Core 类型的对象
- python - 有没有一种简单的方法可以在 python 中模拟指针?
- reactjs - 将 React 客户端和 Rails API 推送到 Heroku,我在构建脚本中遇到错误
- junit4 - 使用“空手道”并行运行器时,Junit xml 报告不报告每个测试用例
- json - 使用 jq 解析 json 输出