Github用户名错误
当我运行此命令时,我已经使用 guthub 在这台计算机上设置了一个名为 myaccount 的先前 github 帐户
ssh -T [email protected]
Hi myaccount! You've successfully authenticated, but GitHub does not provide shell access.
好的,但我现在已经设置了一个名为 samaccount 的新 github 帐户,但我无法运行此命令,但出现此错误。
git push -u origin master
我收到此错误
ERROR: Permission to samueleast/Samuel-East-S3-Audio-Playlist-Player.git denied to myaccount.
我不希望它使用 myaccount 它应该使用 samaccount !
我已遵循此处的所有步骤 http://help.github.com/mac-set -up-git/ 设置全新的 ssh 密钥。
并且还多次运行此命令
git config --global user.name "samaccount"
,但它仍然使用 myaccount 它太烦人了我哪里出错了???
I have setup with guthub with a previous github account on this computer called myaccount when i run this command
ssh -T [email protected]
Hi myaccount! You've successfully authenticated, but GitHub does not provide shell access.
Ok but i have now setup a new github account called samaccount but i cant run this command i get this error.
git push -u origin master
i get this error
ERROR: Permission to samueleast/Samuel-East-S3-Audio-Playlist-Player.git denied to myaccount.
I dont want it to use myaccount it should be using samaccount !!!
i have followed all the steps here http://help.github.com/mac-set-up-git/
setup brand new ssh key.
and also run this command many times
git config --global user.name "samaccount"
but it still uses myaccount its sooo annoying where am i going wrong???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GitHub 会将您识别为
myaccount
,因为 SSH 使用的密钥与已添加到 GitHub 网站上的myaccount
帐户的公钥相对应。如果您想完全切换为使用
sameueleast
帐户而不是myaccount
,您可以执行以下操作:myaccount
身份登录 GitHub 网站samueleast
身份id_rsa.pub
或id_dsa.pub
并位于您的.ssh
目录中。另一方面,如果您希望在推送到 GitHub 时能够使用
myaccount
或samueleast
,则需要为[email protected]
in~/.ssh/config
,例如:假设您已生成第二个 SSH 密钥对并且给他们起了上面的名字。然后,您需要确保在 git 远程 URL 中使用适当的别名。例如,如果您想更改
origin
遥控器,以便推送到 origin 意味着“推送到 origin as samueleast”,您可以执行以下操作:GitHub recognizes you as
myaccount
because SSH is using a key that corresponds to a public key that has been added to themyaccount
account on the GitHub website.If you want to switch entirely to using the
sameueleast
account instead ofmyaccount
, you can do the following:myaccount
samueleast
id_rsa.pub
orid_dsa.pub
and be in your.ssh
directory.On the other hand, if you want to be able to use either
myaccount
orsamueleast
when pushing to GitHub, you will need to create aliases for[email protected]
in~/.ssh/config
, such as:That assumes you've generated a second SSH keypair and given them names as above. Then you need to make sure that you are using the appropriate alias in the URLs of your git remotes. For example, if you want to change your
origin
remote so that pushing to origin means "pushing to origin as samueleast", you could do: