[英]Unable to clone repository from Git
I am new to Git.我是 Git 的新手。 I am trying to clone a repository.
我正在尝试克隆一个存储库。 I am able to clone it using Git bash command.
我可以使用 Git bash 命令克隆它。 But when I try to clone it using STS or Source Tree I get an error saying authentication not supported.
但是当我尝试使用 STS 或 Source Tree 克隆它时,我收到一条错误消息,指出不支持身份验证。 I tried the following still nothing worked.
我尝试了以下仍然没有任何效果。
https.sslVerify false
https.sslVerify false
Please guide me further.请进一步指导我。
Best approach would be to configure using SSH:最好的方法是使用 SSH 进行配置:
ssh-keygen -t rsa -b 4096
(seehere )ssh-keygen -t rsa -b 4096
生成 SSH 密钥(请参阅此处) Copy the content of your public SSH key, it is the file id_rsa.pub
by default.复制您的公共 SSH 密钥的内容,默认情况下它是文件
id_rsa.pub
。
Location: ~/.ssh
(or if you are a window user, it will use whatever $HOME is, ie, $HOME/.ssh
)位置:
~/.ssh
(或者如果您是窗口用户,它将使用 $HOME 是什么,即$HOME/.ssh
)
Paste the content into your GitHub/BitBucket account on the SSH key section将内容粘贴到 SSH 密钥部分的 GitHub/BitBucket 帐户中
Get the repo获取回购
Just clone it:只需克隆它:
GitHub: git clone git@github.com:YOUR_USERNAME/REPO_NAME.git
GitHub:
git clone git@github.com:YOUR_USERNAME/REPO_NAME.git
BitBucket: git clone git@bitbucket.org:USERNAME/REPO_NAME.git
BitBucket:
git clone git@bitbucket.org:USERNAME/REPO_NAME.git
There are 2 methods you can try using您可以尝试使用 2 种方法
git clone https://username@github.com/username/repository.git
git 克隆https://username@github.com/username/repository.git
It will prompt you for your password.它会提示您输入密码。
Alternatively, you can use或者,您可以使用
git clone https://username:password@github.com/username/repository.git
git clone https://username:password@github.com/username/repository.git
for clone repository, you can use this command in terminal对于克隆存储库,您可以在终端中使用此命令
git clone https://github.your_project_url.com/project git clone https://github.your_project_url.com/project
and when it asks for username and password当它要求输入用户名和密码时
user_name: type Github user_name用户名:输入 Github 用户名
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密码:不要使用您在登录 Github 时使用的 Github 密码,而必须使用个人访问令牌
to generate this personal access token open your GitHub account and go to "Settings/Developer settings/Personal access tokens"要生成此个人访问令牌,请打开您的 GitHub 帐户并转到“设置/开发人员设置/个人访问令牌”
thanks谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.