And it seems common at a ton of companies.
And it seems common at a ton of companies.
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?
No account switching on the website, no easy way to use multiple SSH keys to access multiple accounts when using Git.
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.
Host personal.github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_personal
then clone from git@personal.github.com/x.git for personal stuffThanks for the assist fnord77!
`sshuttle -r my-cloud-server 0/0` for a poor man's vpn
`ssh some-enterprise-server` for when the server has a user unfriendly domain name that you don't want to bother remembering
`git clone git@github-personal:myusername/somerepo.git` when you want to clone using your personal key from GitHub.
There is the caveat, though, that you may have some nested dependencies that will use the plain ole every day host name in which case things will break for you. It rarely comes up, though, in my experience.
Also, if the submodules are public, the plain host will work fine because it doesn't matter what key you authenticate with.
[includeIf "gitdir:/home/john/corp/**"]
path = .gitconfig-corp
And then ~/.gitconfig-corp: [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.
git clone git@github.com-corp:corp/foobar.gitBut again, it's just personal preference.