Changing commit author to new account #182929
-
Select Topic AreaQuestion BodyI would like to transfer some repositories to another GitHub accounts, but also transfer the "ownership" of any commits made by the old account to the new one, so it shows that the new account made them. Maybe a way to do this would be to remove the commit email from the old GitHub account and add it to the new one, so it appears that the new one made whatever commits are associated to the old email. Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
You can transfer the repository, but you can’t truly change who authored past commits unless you rewrite Git history. The important thing to know is that GitHub attributes commits based on the email used in the commit, not the account that owns the repo. The safest and recommended approach:
If GitHub says the email is already in use:
This keeps the entire commit history intact and usually solves what you actually want (commits showing on the new profile). If you really need the commits to literally look like they were authored by a different name/email, the only way is to rewrite Git history (for example using git-filter-repo) and force-push. This changes commit hashes and can break forks, PRs, and existing clones, so it should be a last resort. |
Beta Was this translation helpful? Give feedback.
You can transfer the repository, but you can’t truly change who authored past commits unless you rewrite Git history.
The important thing to know is that GitHub attributes commits based on the email used in the commit, not the account that owns the repo.
The safest and recommended approach:
If GitHub says the email is already in use: