无法从github克隆或提取 [英] Can't clone or pull from github
问题描述
当我尝试克隆私人仓库时,在询问用户名和密码后出现以下错误:
When I try to clone a private repo I get the following error, after being asked for username and password:
fatal: Authentication failed
我尝试重新安装最新的git并重新启动Windows 10.
I've tried reinstalling the latest git and rebooting windows 10.
我在github网站设置中尝试的另一件事是删除/删除个人访问令牌的授权(使用我尝试连接的有问题的计算机的名称).在我还收到无法获取本地发行者证书"之类的错误之前
Another thing I've tried from github website settings was removing/deleting the authorization for Personal access token (with the name of the problematic machine I'm trying to connect to). Before I was also getting an error like "unable to get local issuer certificate"
问题开始于今天,当我升级tortoisegit并要求关闭某些应用程序时,其中有一个资源管理器,我担心它以错误的方式杀死了它,并且某些东西损坏了.
The problem started today when I upgraded tortoisegit and it asked to close some applications, among which there was explorer and I'm afraid that it killed it in the wrong way and something got corrupted.
推荐答案
似乎您弄乱了访问令牌.我建议您为计算机设置新的SSH密钥,并将其添加到GitHub存储库中. 您可以关注
Seems like you messed up your access token. I recommend you to setup new SSH keys for your machine and add them to GitHub repo. You can Follow this official help page from github.
不使用SSH进行克隆的另一种方法是使用HTTPS进行克隆,此处克隆的语法与公共存储库略有不同. 对于公共回购,您就像
Another way to clone without SSH is to clone using HTTPS, here the syntax for the clone is slightly different from public repositories. For public repos, you go like
git clone https://github.com/myUserName/myProject.git
对于私人回购,您就像
git clone https://myUserName:myGithubPassword@github.com/myUserName/myProject.git
注意:
- 如果您的密码包含特殊字符,则需要将具有特殊字符的密码转换为UTF-8编码.
您可以从此处获取替换指南.
或者,您可以使用此javaScript代码转换密码并使用生成的密码
console.log(encodeURIComponent('password_of_the_form@$123'));
- 如果您使用2FA保护GitHub帐户的安全,则
- If your password contains special characters, you will need to convert password with special characters to UTF-8 encoding.
You can take replace guide from here.
Or you can use this javaScript code to convert your password and use generated password
console.log(encodeURIComponent('password_of_the_form@$123'));
- If you use 2FA to secure your GitHub account then follow this
这篇关于无法从github克隆或提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!