-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide alternative to SSH for accessing private repo dependencies (#…
…6245) Fixes #6234 --------- Co-authored-by: Parker Lougheed <[email protected]>
- Loading branch information
1 parent
f70f55a
commit 557aca9
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,16 +141,21 @@ dependencies: | |
The `git` here says this package is found using Git, and the URL after that is | ||
the Git URL that can be used to clone the package. | ||
|
||
Even if the package repo is private, if you can | ||
[connect to the repo using SSH,][GitHub SSH] | ||
then you can depend on the package by using the repo's SSH URL: | ||
Even if the package repo is private, | ||
you can configure your `git` setup to access the repo using an | ||
[HTTPS access key][GitHub HTTPS] or an [SSH key-pair][GitHub SSH]. | ||
Then you can depend on the package by using the repo's corresponding URL: | ||
|
||
```yaml | ||
dependencies: | ||
kittens: | ||
# SSH URL: | ||
git: [email protected]:munificent/kittens.git | ||
``` | ||
|
||
The `dart pub` command calls `git clone` as a subprocess, so all you need to | ||
provide is a `<url>` that works when `git clone <url>` is executed. | ||
|
||
If you want to depend on a specific commit, branch, or tag, | ||
add a `ref` key to the description: | ||
|
||
|
@@ -557,6 +562,7 @@ to differentiate versions. <a href="#fnref:semver">↩</a> | |
|
||
</aside> | ||
|
||
[GitHub HTTPS]: https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git | ||
[GitHub SSH]: https://help.github.com/articles/connecting-to-github-with-ssh/ | ||
[pub package manager]: /tools/pub/packages | ||
[`dart pub get`]: /tools/pub/cmd/pub-get | ||
|