diff options
Diffstat (limited to 'doc/gitlab-basics/start-using-git.md')
-rw-r--r-- | doc/gitlab-basics/start-using-git.md | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md index c6de723246c..875bd00ee55 100644 --- a/doc/gitlab-basics/start-using-git.md +++ b/doc/gitlab-basics/start-using-git.md @@ -148,7 +148,7 @@ between your computer and GitLab. ``` 1. GitLab requests your username and password: - - If you have 2FA enabled for your account, you must use a [Personal Access Token](../user/profile/personal_access_tokens.md) + - If you have 2FA enabled for your account, you must [clone using a token](#clone-using-a-token) with `read_repository` or `write_repository` permissions instead of your account's password. - If you don't have 2FA enabled, use your account's password. @@ -163,6 +163,24 @@ On Windows, if you enter your password incorrectly multiple times and an `Access add your namespace (username or group) to the path: `git clone https://namespace@gitlab.com/gitlab-org/gitlab.git`. +#### Clone using a token + +Clone with HTTPS using a token if: + +- You want to use 2FA. +- You want to have a revokable set of credentials scoped to one or more repositories. + +You can use any of these tokens to authenticate when cloning over HTTPS: + +- [Personal access tokens](../user/profile/personal_access_tokens.md). +- [Deploy tokens](../user/project/deploy_tokens/index.md). +- [Project access tokens](../user/project/settings/project_access_tokens.md). +- [Group access tokens](../user/group/settings/group_access_tokens.md). + +```shell +git clone https://<username>:<token>@gitlab.example.com/tanuki/awesome_project.git +``` + ### Convert a local directory into a repository You can initialize a local folder so Git tracks it as a repository. |