Add docs for git authentication (#1844)

[Rendered](https://github.com/astral-sh/uv/blob/zb/auth-docs/README.md#git-authentication)

Adds docs for
- #1781 
- #1717
This commit is contained in:
Zanie Blue 2024-02-21 20:30:11 -06:00 committed by GitHub
parent 7eaed07f6c
commit d80eee1f8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 22 additions and 0 deletions

View File

@ -173,6 +173,28 @@ Since uv has no dependency on Python, it can even install into virtual environme
its own. For example, setting `VIRTUAL_ENV=/path/to/venv` will cause uv to install into
`/path/to/venv`, no matter where uv is installed.
### Git authentication
uv allows packages to be installed from Git and supports the following schemes for authenticating with private
repositories.
Using SSH:
- `git+ssh://git@<hostname>/...` (e.g. `git+ssh://git@github.com/astral-sh/uv`)
- `git+ssh://git@<host>/...` (e.g. `git+ssh://git@github.com-key-2/astral-sh/uv`)
See the [GitHub SSH documentation](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) for more details on how to configure SSH.
Using a password or token:
- `git+https://<user>:<token>@<hostname>/...` (e.g. `git+https://git:github_pat_asdf@github.com/astral-sh/uv`)
- `git+https://<token>@<hostname>/...` (e.g. `git+https://github_pat_asdf@github.com/astral-sh/uv`)
- `git+https://<user>@<hostname>/...` (e.g. `git+https://git@github.com/astral-sh/uv`)
When using a GitHub personal access token, the username is arbitrary. GitHub does not support logging in with password directly, although other hosts may. If a username is provided without credentials, you will be prompted to enter them.
If there are no credentials present in the URL and authentication is needed, the [Git credential helper](https://git-scm.com/doc/credential-helpers) will be queried.
### Dependency caching
uv uses aggressive caching to avoid re-downloading (and re-building dependencies) that have