无法将本地 git master 同步到现有的 git hub 远程存储库

Can't sync local git master to existing git hub remote repository

我目前有一个学校项目的本地 git 大师,该项目已上传到 github 帐户。然后我使用 github 在线将我的存储库转移到第二个 github 帐户(出于专业原因,我正在重塑品牌)。效果不错。

新问题是有两个 GitHub 远程存储库。我删除了第一个 GitHub 存储库,然后添加了第二个,但是当我尝试

git push --set-upstream origin master

我很快得到通知:

remote: Permission to *****/****.git denied to myOldUserAccount.
fatal: unable to access 'https://github.com/*****/****.git/': The requested URL returned error: 403

我觉得这是 GitHub 的登录问题。我如何授权我的第二个帐户处理我第一个帐户的事务?我所有的搜索只返回 Logout and login as another user git bash,这在这种情况下没有帮助。

无法访问您的远程存储库,请检查您的 .git/config 文件 并检查

url = https://github.com/username/yourrepositoryname.git

正确吗? 如果 url 正确但仍然出现错误,则可以使用 url.

添加密码
url = https://username:password@github.com/username/yourrepositoryname.git

我认为它有效。