I have two GitHub accounts, one of this was created a long time ago at my work and has an username that refers to the company where I work.
I have another account which is my personal GitHub account that I can't stop using.
Could I merge the two accounts so I can work in only one of these?
If you have separate accounts for work and personal use, you can merge the accounts. Tip: We recommend using only one personal account to manage both personal and professional repositories. Warning: Organization and repository access permissions aren't transferable between accounts.
Go to Settings . From the left side navigation, click SSH and GPG keys . Click on New SSH key , name it (it's a good idea to name it after the computer you're using it in), and paste the key you previously copied. Click Add key .
Merging 2 accounts is not possible at github, you can transfer ownership to your personal account.
goto >> Setting >>Transfer ownership
For more details : https://help.github.com/articles/merging-multiple-user-accounts/
Responding with updated answer here (relevant in 2019).
Luckily this is a relatively quick process to 1) transfer repo ownership, 2) manage (add/remove/change) account email addresses, and 3) keep/transfer most commit history to the profile’s contribution graph.
Transferring repository ownership only requires a few steps.
Repo transfers between accounts includes all issues, pull requests, forks, stars, alongside automatic redirects being setup for git and http. Though you should update your remote’s origin URL once the transfer is complete: git remote set-url origin new_url
Git commit history, SAML, and other items are tied to the email(s) you have on-file within GitHub and in your remote, local setup. Keeping/transferring commit history to contribution graph comes when you add original, authoring email/verify it on user account you're consolidating/merging into.
Previous note about most history transferring is referring to PRs and issues which fall under this "grey area" of history and will not transfer when combining accounts.
After you've added email to GH user account + verified it, most commit history will transfer. Allow GitHub a bit of time to propagate the history and contributions between accounts.
You will lose commits tied to original pull requests and issues histories tied to account you're removing. These “...would instead be attributed to our “Ghost” user once the account is deleted, though the issues/PRs themselves would otherwise be unaffected.” (from GH Support). If you're looking to read more, I wrote up a quick blog article for this with steps and visuals on transferring repo ownership, adding emails, and more - how to merge/combine two (or many) GitHub user accounts.
GitHub does recommend using one user account for personal and professional (work) repositories (source), definitely consider doing so!
Managing multiple user accounts can be cumbersome, though there are ways to simplify workflow of multiple accounts, though, so in the case this response wasn't for you and you want to keep your many accounts as-is, see how to manage multiple GH accounts on one machine with SSH keys.
While Github outlines a limited "Merging multiple user accounts" process, which is also mentioned in previous answers, it is not a complete solution. It does not resolve ownership in third party repositories contributions.
GitHub will display comments from a deleted user (which will be the account you got rid of following GitHub's account merge suggestion) as "ghost" user's comments - without attributing them to the surviving account. See some more details here:
https://help.github.com/articles/deleting-your-user-account/
So in reality as of November 2016 there is no general way to fully merge all contributions from one account to another.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With