如何在GitHub中更改PR的作者? [英] How to change the author of a PR in GitHub?

查看:108
本文介绍了如何在GitHub中更改PR的作者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法更改在GitHub存储库中推送更改的人(帐户).

I want to know if there is a way to change the person(account) who pushed changes in a GitHub repository.

例如:我以不同的名称(不是电子邮件)推送到我的私有存储库,但是我拼错了我的名字中的一个字母,并且GitHub将提交标记为userame而非用户名提交;

For example: I push to my private repository under a different name(not email) but I misspell one letter of my name and GitHub marks the commit as commited by userame not username;

推荐答案

我建议您修复提交程序.请记住,提交用户和提交者之间是有区别的.提交者在 .git/config 文件夹内签名:

I suggest you to fix the committer. Remember that there is a difference between the user who commit, and the committer. The committer is signed inside .git/config folder:

$ cat .git/config
[user]
    name = John Doe
    email = john.doe@example.com

现在,您只需要 git commit --amend git push origin BRANCH -f .前一个命令再次提交(但是这次更新了提交者).后者,覆盖分支.

Now, you just need to git commit --amend and git push origin BRANCH -f. The former command commit again (but this time with the committer updated). The latter, overwrite the branch.

这篇关于如何在GitHub中更改PR的作者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆