我已经开始玩Git并遇到过"上游"和"下游"这两个词.我之前见过这些,但从未完全理解它们.这些术语在SCM(软件配置管理工具)和源代码的上下文中意味着什么?
自从我把任何东西推到GitHub以来已经有一段时间了.我最初在计算机上设置了帐户,一切都很顺利.然后我将我的帐户更改为客户的帐户(因此我可以将代码推送到他们的私人存储库).
已经有一段时间了,现在我正在改回旧帐户,我遇到了麻烦.我生成了一个新的rsa_key,并且几乎遵循了这里的指令.
但是,当我输入:ssh -T git@github.com我得到:
嗨oldincorrectusername!您已成功通过身份验证,但GitHub不提供shell访问权限.
我也不能推送到我的回购,因为这个旧的客户端用户名未经授权.我在我的计算机和GitHub上的帐户设置上都仔细检查了我的ssh密钥.
我还设置了我的全局帐户变量:
git config --global user.name "Firstname Lastname"
git config --global user.email "your_email@youremail.com"
git config --global github.user username
git config --global github.token 0123456789yourf0123456789token
Run Code Online (Sandbox Code Playgroud)
它仍然是给我旧的用户名.
有什么建议?
谢谢,
是否可以临时更改"git push remote master"的ssh用户而不会搞乱.git/config或"git remote",或者使用整个远程url?
[root@host gitrepo]# git push otheruser@remote master # this does not work, but how great it would be
[root@host gitrepo]# USER=otheruser git push remote master # still asks password for root
Run Code Online (Sandbox Code Playgroud)