GitHub -PR Commit显示旧用户名为作者。如果我没有回购许可,我该如何更改Commit的作者?

发布于 2025-01-30 18:41:06 字数 291 浏览 5 评论 0原文

几个月前,我向私人组织仓库建立了PR(私人用户必须请求访问才能查看它,从技术上讲是私人的,但实际上并非如此)。很长一段时间没有被接受,所以在此之后的一段时间我决定更改我的github用户名。最近,令我惊讶的是,公关被接受并合并。但是,它现在将我的旧用户名列为PR Merge Commit中的作者,并且不链接到我的个人资料(但是,PR本身在提交标题中链接,仍然链接到我的个人资料)。

如果我将用户名更改回旧的链接(顺便说一句,我从未更改过我的github电子邮件),将再次更改指向我的个人资料链接?如果没有,是否可以解决此问题(如果我无法控制此存储库)?

A couple of months ago I made a PR to a private org repo (private as in, public users have to request access in order to view it, technically private but not really). It didn't get accepted for a long time, so some time after this I decided to change my GitHub username. Recently, to my surprise however, the PR got accepted and merged. However, it now lists my old username as the author in the PR merge commit and does not link to my profile (the PR itself however, that is linked in the commit title, still links to my profile).

Will the commit change link to my profile again if I change my username back to my old one (I have never changed my GitHub email by the way)? If not, is there a way to fix this (if I have no control over this repo whatsoever)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無心 2025-02-06 18:41:07

关于更改提交的作者。提交与您的GitHub帐户没有直接相关。

委员会有一个与他们相关的参数和作者。它们是由您(或更确切地说是通过git)设置的,然后再推动远程推动。

您可以从字面上提交任何电子邮件和任何名称,即使是另一个用户,Github也会接受它,并且可以像其他人一样将其合并。

基本上,您无能为力,唯一的方法就是覆盖存储库的GIT历史记录,但是大多数维护者都不愿意这样做,因为这可能会很混乱。

如果这是一个公共项目或共享分支机构,那么愿意为您做到这一点的可能性甚至较小。

您只需要接受该提交带有您的旧名称/电子邮件即可。

TL; DR:委员和作者存储在犯罪中。当您进行git推动…时,您只需要进行身份验证即可通过GitHub帐户进行推动,但这与存储在提交中的细节无关。


至于合并提交消息,您可以通过将用户名更改回旧链接,从技术上修复合并提交中的链接。但是,我不会说这值得做。

该提交仍然归因于您,这只是合并提交消息,不再解决您的个人资料,因为它只是一个明文字段。在提交消息,提取请求说明和注释中,github将@usernames链接到相应的配置文件。与Twitter这样的其他平台的执行方式相同。仅仅因为某人以前提到您并不意味着您现在需要坚持终身用户名!

Regarding changing the author of a commit. Commits aren't directly associated with your GitHub account.

Commits have a committer and author associated with them. They are set by you (or rather by Git) on your machine before pushing remotely.

You can literally commit with any email and any name, even one from another user and GitHub will accept it, and it can be merged looking like it was made by someone else.

There's basically nothing you can do, the only way would be to overwrite the Git history of the repository, but most maintainers wouldn't be willing to do that since it can be messy.

If it's a public project or shared branch, it's even less likely that'd be willing to do that for you.

You'll just have to accept that that commit has your old name/email.

TL;DR: The committer and author are stored in the commit. When you do git push … you only need to authenticate to push via your GitHub account, but that has nothing to do with the details stored in the commit.


As for the merge commit message, you can technically fix the link in your merge commit by changing your username back to the old one. However, I wouldn't say it's worth doing.

The commit is still attributed to you, it's just the merge commit message that no longer resolves to your profile because it's simply a plaintext field. In commit messages, pull request descriptions, and comments, GitHub links @usernames to the respective profile. It's the same as how other platforms like Twitter do it. Just because someone mentioned you before doesn't mean you need to hold on to that username for life now!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文