I have made several commits using a GitHub account on a private repository. I would however like to switch my github account and also transfer the commit history to the new account as-if I was always using the new account. Is there a way to accomplish this in GitHub? I read about transferring repository but my the repository is not owned by me and also doesn't provide an option to transfer.
Asked
Active
Viewed 198 times
1 Answers
1
If you can clone the repository, you need then to use newren/git-filter-repo in order to rewrite the author from your old account to your new account.
See "How to change commit author for multiple commits using filter branch?" and
"git filter-repo
/ User and email based filtering"
git filter-repo --mailmap my-mailmap
with my-mailmap
:
Correct Name <correct@email.com> <old@email.com>
Then you can create a new empty repository on GitHub, and push everything to it:
git remote set-url https://github.com/<me>/newRepo>
git push --mirror

VonC
- 1,262,500
- 529
- 4,410
- 5,250