我怎样才能访问这个仓库?

How can I get access to this repo?

我一直在尝试将文件推送到我 "user21" 帐户上的 github 存储库。

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

但它说我需要一个我很久以前创建的名为 "user1212114" 的帐户的许可,而且我也忘记了密码。

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

我使用的是 Powershell 而不是 git bash 终端。

Git 如何存储 https 凭据有点混乱。安装与安装不同。使用 git remote set-url origin git@github.com:user21/sample-site.git 切换到 ssh 通常更容易。 Github has a guide how to set up ssh 一旦你遵循了,事情就容易多了。


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

您可以使用 git config --global credential.helper 查看内容。如果它是 Git For Windows(又名 Git Bash),您可能正在使用 wincred,它是本机 Windows 凭据管理器。如果是这样,您将打开 Windows 凭据管理器,找到该 Git 集线器 URL 的凭据并进行更改。

我从未使用过 Windows 凭据管理器,但是 here's a tutorial