如何推送到另一个用户下的远程仓库

How to push to remote repo under another user

我在另一个作者下检查了这个关于提交的问题git commit as different user without email / or only email
我怎样才能在另一个登录名下推送到远程仓库。我愿意:

git commit --author="notMe" -m "whatever"
git push https://<remote-repo>
Username for 'https://github.com': notMe
Password for 'https://qRoman@github.com': <notMe's password>

但结果我得到了这个: 我怎样才能像其他作者一样提交和推送?


更新: 我尝试了 git config user.name "notMe" 结果是:

差不多就是我想要的了,但为什么我的头像还在?

您以作者 "notMe" 的身份创建了提交,但使用该存储库的当前用户(即 Alendorff)进行了推送。 您可以通过以下方式更改该回购的用户:

git config user.name "Billy Everyteen"

您还可以通过以下方式检查当前用户的存储库:

git config user.name

更多可以找到here

您需要指定提交作者的姓名和电子邮件,才能完全消除您当前帐户的痕迹。