WINDOWS
I made this configuration for windows, but you can change it to linux/mac effortlessly.
I'm assuming that you have 2 sshkeys already installed and added in ssh-agent: one personal and other for work (corp).
Change/Create a ~/.ssh/config file with the content:
%USER%/.ssh/config
Host gitlab.com-corp
HostName gitlab.com
User git
IdentityFile ~/.ssh/corp_id_ed25519
Host github.com-corp
HostName github.com
User git
IdentityFile ~/.ssh/corp_id_ed25519
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
Host gitlab.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_ed25519
Inside your project, change the .git/config file with the follow remote configuration:
.git/config
...
[remote "github"]
url = git@github.com-corp:my-corporation/my-corp-project.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "gitlab"]
url = git@gitlab.com-corp:my-corporation/my-corp-project.git
fetch = +refs/heads/*:refs/remotes/gitlab/*
...
Test it:
git fetch github
git fetch gitlab