Unable to clone repository from Git
Solution 1
There are 2 methods you can try using
- Try cloning by adding your git username on the clone URL
git clone https://[email protected]/username/repository.git
It will prompt you for your password.
Alternatively, you can use
git clone https://username:[email protected]/username/repository.git
Or by using user token in case of Github
git clone https://username:[email protected]/username/repository.git
- Adding an SSH key on GIT generated from your machine. Use the link shared below to generate one https://help.github.com/en/enterprise/2.17/user/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Solution 2
for clone repository, you can use this command in terminal
git clone https://github.your_project_url.com/project
and when it asks for username and password
user_name: type Github user_name
password: don't use Github password which you use at the time of login to Github, instead, you have to use a personal access token
to generate this personal access token open your GitHub account and go to "Settings/Developer settings/Personal access tokens"
thanks
Solution 3
Best approach would be to configure using SSH:
- Generate the SSH key with
ssh-keygen -t rsa -b 4096
(see here) -
Copy the content of your public SSH key, it is the file
id_rsa.pub
by default.Location:
~/.ssh
(or if you are a window user, it will use whatever $HOME is, i.e.,$HOME/.ssh
) Paste the content into your GitHub/BitBucket account on the SSH key section
Get the repo
Just clone it:
GitHub: git clone [email protected]:YOUR_USERNAME/REPO_NAME.git
BitBucket: git clone [email protected]:USERNAME/REPO_NAME.git
Comments
-
Praveen Kumar almost 2 years
I am new to Git. I am trying to clone a repository. I am able to clone it using Git bash command. But when I try to clone it using STS or Source Tree I get an error saying authentication not supported. I tried the following still nothing worked.
- Created Personal Access Token with api and read_user access.
- Tried adding
https.sslVerify false
- Generated RSA Key from windows-->preferences-->Network Connection-->SSH2-->KeyManagement and pasted the public key.
Please guide me further.
-
nivritgupta almost 6 yearsSometime Sourcetree gives so many authentication issue when trying to clone or even take a new pull , just delete the previous stored username and password on sourcetree or maybe this link help you community.atlassian.com/t5/Bitbucket-questions/…
-
Praveen Kumar almost 6 yearsI am able to clone, push, pull using commands. I am trying to do it from IDE which I am not able to do.
-
beingmanish almost 6 yearswhich IDE you are using ?
-
Praveen Kumar almost 6 yearsSpring Tool Suite 3.9.3
-
Naval Hasan over 2 yearsthat worked for me. thanks