Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 我如何才能访问此回购协议?_Bash_Git_Github_Git Bash - Fatal编程技术网

Bash 我如何才能访问此回购协议?

Bash 我如何才能访问此回购协议?,bash,git,github,git-bash,Bash,Git,Github,Git Bash,我一直试图在我的“user21”帐户上将文件推送到我的github repo 但它说我需要一个名为“user1212114”的帐户的许可,这个帐户是我多年前创建的,我也忘记了密码 如何删除旧帐户并修复此错误?我使用了Powershell,而不是git bash终端。git如何存储https凭据有点混乱。不同的安装是不同的。使用git-remote-set-url-origin切换到ssh通常更容易git@github.com:user21/sample site.git。一旦你遵循了这一点,事情

我一直试图在我的“user21”帐户上将文件推送到我的github repo

但它说我需要一个名为“user1212114”的帐户的许可,这个帐户是我多年前创建的,我也忘记了密码


如何删除旧帐户并修复此错误?

我使用了Powershell,而不是git bash终端。git如何存储https凭据有点混乱。不同的安装是不同的。使用
git-remote-set-url-origin切换到ssh通常更容易git@github.com:user21/sample site.git
。一旦你遵循了这一点,事情就容易多了


为了修复现有的问题,您必须了解如何存储https凭据。仅仅把你的密码放在一个文件中是不安全的,密码永远不会以可恢复的形式存储,任何获得该文件的人都会知道你的密码。它需要使用安全的东西

您可以使用
git config--global credential.helper
检查内容。如果是Git For Windows(又名Git Bash),那么您可能正在使用本机Windows凭据管理器
wincred
。如果是这样,您应该打开Windows凭据管理器,找到该Github URL的凭据,然后更改它们


我从未使用过Windows Credent Manager,但是。

你是说你想使用另一个可以访问此存储库的帐户吗?@Schwern不,我想使用“user21”帐户,但每次我尝试将我的提交推送到我创建的repo,它一直在说我在几年前创建的这个旧帐户拒绝了烫发。您想从使用
user1212114
访问存储库切换到使用
user21
?@Schwern这是right@Schwern你知道我该怎么修吗?
git push -u origin master
remote: Permission to user21/simple-site.git denied to 
user1212114.
fatal: unable to access 'https://github.com/user21/simple-site/': The 
requested URL returned error: 403