flutter/docs/infra/Updating-dependencies-in-Flutter.md
Kate Lovett 1fbcbb73a0
[wiki migration] Leftover wiki pages and links (#148989)
This is waiting on 
- https://github.com/flutter/flutter/pull/148777
- https://github.com/flutter/flutter/pull/148790

After this PR lands, there will likely be 1-2 more clean up PRs, after which the migration will be done!

---

This moves the remaining wiki pages as planned in [flutter.dev/go/migrate-flutter-wiki-spreadsheet](https://docs.google.com/spreadsheets/d/1x65189ZBdNiLRygpUYoU08pwvXD4M-Z157c6pm8deGI/edit?usp=sharing) 

It also adds the team labels to the label bot for future PRs.

Changes to the content were only updating cross links, or links to refer to the main branch rather than master.
Remaining links to the wiki will be updated once all other pages have finished moving, they still work in the meantime.

Part of https://github.com/flutter/flutter/issues/145009
2024-05-28 15:12:10 +00:00

22 lines
1.1 KiB
Markdown

Instead of manually updating dependencies in a `pubspec.yaml` file, use the [`update-packages`](packages/flutter_tools/lib/src/commands/update_packages.dart) CLI tool:
## To update all dependencies:
`flutter update-packages --force-upgrade`
## To pin a dependency:
Sometimes you need to prevent a dependency from being updated when you run `flutter update-packages --force-upgrade`.
In that case, first pin the dependency in [`kManuallyPinnedDependencies`](https://github.com/flutter/flutter/blob/5bd34ef541575eddae6aaa82fc76a59ae7e464c3/packages/flutter_tools/lib/src/update_packages_pins.dart#L17) and a include a comment with a link to an issue to unpin the dependency.
You can then re-run `flutter update-packages --force-upgrade`.
## To update a single dependency for cherrypicks:
Sometimes you need to update a single dependency as a [cherrypick to a release candidate branch](../releases/Flutter-Cherrypick-Process.md).
In that case, you can run:
`flutter update-packages --cherry-pick-package=[pub package name] --cherry-pick-version='[pub package version]'`