From c3b58810535a8d6e6587f555d1c1d69168f8d25e Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Thu, 14 Dec 2023 20:07:22 +0100 Subject: [PATCH] Add note about `--git-ref` to `pub global` (#5408) I wanted to know how to specify a commit for a package I want to install, and I noticed that the option isn't in the documentation. Co-authored-by: Parker Lougheed --- src/tools/pub/cmd/pub-global.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tools/pub/cmd/pub-global.md b/src/tools/pub/cmd/pub-global.md index c7aa025f9e..628d229798 100644 --- a/src/tools/pub/cmd/pub-global.md +++ b/src/tools/pub/cmd/pub-global.md @@ -82,6 +82,13 @@ a path relative to the repository root: $ dart pub global activate -sgit https://github.com/dart-lang/http.git --git-path pkgs/http/ ``` +Pub uses the default branch of the Git repository. To specify a +different branch or commit, use the `--git-ref` option: + +```terminal +$ dart pub global activate -sgit https://github.com/dart-lang/http.git --git-ref 36f98e900347335af2338a0e087538009b7de2f9 +``` + ### Activating a package on your local machine ```terminal