I'm really surprised at the number of personal GitHub accounts that are being used in my org and at others. I guarantee their access isn't being removed when they depart.
GitHub actually manages attaching business org to personal accounts very well.
You can make notification emails related to the business org repos go to your work email, while all other notification emails go to your personal email.
When you fork a business org private repo into your account, it stays attached to the business org. Other members of the org can push to your fork of that repo but not your other personal or open-source repos. When your account is separated from the org, you lose access to your fork.
If the business org requires extra SAML/OIDC through their central auth service, you can still access your personal and public repos without doing it.
So yeah the business still has to remember to disconnect you from the org when you leave the company, but that's still true if you make a new github account anyway?
Shouldn't you mostly be using them on separate computers though? The rare times I need my personal one at work (to view how I solved something before), I just open Incognito.
I'm self-employed and always on-call. Not suggesting this is the right way for anyone else, but trying to unravel a combined life to even multiple accounts on a single computer sounds like a nightmare.
You can set up a new host in your ssh config and specify a key different from your main account and it should swap your accounts based on the key. Additionally, you can set a git config to be included if you’re in a particular directory so that you can change your commit details.
I’m on a mobile device so excuse the vagueness, but if there’s interest I can provide some resources and go more in depth.
[user]
email = john@example.com
name = John Doe
[url "git@github.com-corp"]
insteadOf = git@github.com
Now all repos under the path /home/john/corp/ will use that config. Then you can put a new host in your SSH config:
Host github.com-corp
HostName github.com
User git
IdentityFile /home/john/.ssh/corp_github
This way you can have different e-mail address and name in your commit messages as well.
Due to the nature of git you can't scope it via GH URL (you can have many remotes in the same local repo). Though you can still manually rewrite when you add a remote with just the SSH config change, e.g.
This is a limitation that I haven't really found a way through. I haven't tried too hard though because I've found that I can often just let the complicating set up have the 'plain' github.com host and use the custom host for the other set up. If I found that both professionally and personally I needed submodules, though, I'd probably be in trouble.
Also, if the submodules are public, the plain host will work fine because it doesn't matter what key you authenticate with.
You can make notification emails related to the business org repos go to your work email, while all other notification emails go to your personal email.
When you fork a business org private repo into your account, it stays attached to the business org. Other members of the org can push to your fork of that repo but not your other personal or open-source repos. When your account is separated from the org, you lose access to your fork.
If the business org requires extra SAML/OIDC through their central auth service, you can still access your personal and public repos without doing it.
So yeah the business still has to remember to disconnect you from the org when you leave the company, but that's still true if you make a new github account anyway?