git clone https://gitlab.com:<private token>@gitlab.com/myuser/myrepo.git
Trying to clone private repository I have error " fatal: Authentication failed "
What am I doing wrong?
make sure that you have added ssh key in your system. Follow this : https://gitlab.com/profile/keys . Once added run the above command. It will prompt for your gitlab username and password and on authentication, it will be cloned.
Make sure you have created a Personal Access Token on your Gitlab account with access to api scope. Also, the token must be not expired.
I used this and worked for me:
git clone https://gitlab.com:<personal_access_token>@gitlab.com/user/repo.git'
FYI: I haven't set up Two-Factor Authentication (2FA), maybe this could be your problem if you have set 2FA in your account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With