From d80eee1f8cc6c8f15ff5fd265cf72b67edb6c4c1 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 21 Feb 2024 20:30:11 -0600 Subject: [PATCH] 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 --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 4e8294c72..c4884935a 100644 --- a/README.md +++ b/README.md @@ -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@/...` (e.g. `git+ssh://git@github.com/astral-sh/uv`) +- `git+ssh://git@/...` (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://:@/...` (e.g. `git+https://git:github_pat_asdf@github.com/astral-sh/uv`) +- `git+https://@/...` (e.g. `git+https://github_pat_asdf@github.com/astral-sh/uv`) +- `git+https://@/...` (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