【问题标题】:How to allow permission to my new github account如何允许对我的新 github 帐户的权限
【发布时间】:2020-04-06 13:17:13
【问题描述】:

我刚刚完全更改了我的 Github 帐户。我已经卸载了 GIt 并重新安装并重新设置了 user.name 和 user.email,但它仍然拒绝我将我的内容推送到我的存储库中看到旧用户名 (johnngondi)。

GIT 响应性 $ git remote add origin https://github.com/aliesoft/alienspine.git

推送请求

$ git push -u origin master

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

这是 GIT 配置列表

$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
credential.helper=manager
gui.recentrepo=C:/Users/AlienSoft Tech/GIT
user.email=aliensofttechnologies@gmail.com
user.name=AlieSoft Technologies
color.ui=true
core.editor=emacs
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://github.com/aliesoft/alienspine.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

我已经检查了原始存储库并显示了这个

$ git config --get remote.origin.url
https://github.com/aliesoft/alienspine.git

当我测试我生成的密钥时,它表明连接成功。

$ ssh -T git@github.com
Hi aliesoft! You've successfully authenticated, but GitHub does not provide shell access.

如何让它停止使用旧用户名 johnngondi

【问题讨论】:

  • 我的最终决定是下载桌面版 Github。我仍然想使用命令行。因此,如果您找到解决方案,请发布您的答案。

标签: git github


【解决方案1】:

这是你的问题:

$ git config --get remote.origin.url https://github.com/aliesoft/alienspine.git

您正在使用 HTTPS 协议。您可以尝试使用公共和私有 RSA 密钥来访问您的 git 存储库。可以在此处找到有关如何生成公钥并将其添加到个人资料的教程:https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

设置 SSH 密钥后,尝试将您的代码推送到 git@github.aliesoft/alienspine.git。更改您的远程来源:

git remote set-url origin git@github.com:aliesoft/alienspine.git

【讨论】:

  • 谢谢拉里,让我试试看。
  • 我已经这样做了,但仍然失败$ eval $(ssh-agent -s) Agent pid 1129我添加了密钥$ ssh-add ~/.ssh/id_rsa Identity added: /c/Users/AlienSoft Tech/.ssh/id_rsa (aliensofttechnologies@gmail.com)我已经更改了存储库$ git remote set-url origin git@github.aliesoft/alienspine.git推送后这是回复$ git push -u origin master fatal: 'git@github.aliesoft/alienspine.git' does not appear to be a git repository fatal: Could not read from remote repository.请确保你有正确的访问权限和存储库存在。
  • 谢谢。让我试试
猜你喜欢
  • 2021-04-15
  • 1970-01-01
  • 2017-05-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多