Today I've enabled Gitlab's 2nd-factor authentication. After that, since I logged in the Gitlab website, I need to use my cell phone to pass a 6-digits plus my password, that's good, it makes me feel safe.
However, when I use the general operations, for example git clone some-repo.git
, I got the error:
Cloning into 'some-repo'...
remote: HTTP Basic: Access denied
remote: You must use a personal access token with 'api' scope for Git over HTTP.
remote: You can generate one at https://gitlab.com/profile/personal_access_tokens
fatal: Authentication failed for 'some-repo.git'
Then I try existing cloned local repo, using git pull
, the same error occurs. Before I enabled the 2nd-factor authentication, all the above operation worked fine.
Flowing the above error's instructions, I went to the mentioned address: https://gitlab.com/profile/personal_access_tokens. I created the following token, and save the token's key.
However, I don't know what to do with this key. Can someone tell me how to use this key to enable the basic operations like git pull
, git clone
, git push
etc...
Edit
I had many repos on local before I enabled the 2nd-factor authentication. I want these to work too.