gpt4 book ai didi

dart - 您如何强制 'pub get' 从 git 获取最新信息?

转载 作者:IT王子 更新时间:2023-10-29 06:35:21 25 4
gpt4 key购买 nike

我的 pubspec.yaml 文件中有一个 git 依赖项,当 git 存储库中发生新更改时,我如何强制更新它?

flutter pub get / pub get

它没有得到最新的,因为它在 .pub-cache/git/

有没有办法强制特定依赖项从 pubspec.yaml 中引用的 git 存储库更新?

最佳答案

在您的 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 强制更新

关于dart - 您如何强制 'pub get' 从 git 获取最新信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53484122/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com