Managing multiple GitHub accounts for work, side projects, and open-source contributions doesn't have to be a nightmare. Here is a straightforward guide to keeping your personal and professional Git environments perfectly separated.
By default, Git uses a single global identity — one name, one email, and one SSH key. When you have multiple GitHub accounts (e.g. a personal account and a work account), every repo on your machine will commit under the same identity, and SSH will always try the same key regardless of which account you need.
You wouldn't want to accidentally commit to an open-source repository with your work email, or vice versa.
Organize your workspaces in a way that makes sense to you. This way you will always, know which git config you need to use for which repo, based on your working path.
# Organize your workspaces
.
├── opensource # Open-source projects should use san-siva@gmail.com
├── sidegig # Side Projects, should use san-siva@sidegig.com
└── work # Personal projects, should use san-siva@work.com
Start by configuring your global ~/.gitconfig file. It should contain your primary name and email address, acting as the default fallback identity for any repository outside your specialized workspaces.
# ~/.gitconfig
[user]
email = san-siva@gmail.com
name = Santhosh Siva
[pull]
rebase = false # set this to true if you want to rebase instead of merge
[submodule]
recurse = true # optional, if you are dealing with monorepos
Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
# ~/.gitconfig__work
[user]
email = san-siva@work.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# ~/.gitconfig__sidegig
[user]
email = san-siva@sidegig.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
# ~/.gitconfig
[user]
email = san-siva@gmail.com
name = Santhosh Siva
[pull]
rebase = false # set this to true if you want to rebase instead of merge
[submodule]
recurse = true # optional, if you are dealing with monorepos
# Add these lines to your global config
[includeIf "gitdir:/Users/san.siva/work/"]
path = ~/.gitconfig__work
[includeIf "gitdir:/Users/san.siva/sidegig/"]
path = ~/.gitconfig__sidegig
For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
Start by creating a dedicated SSH key for each of your GitHub accounts. Using the ed25519 algorithm is highly recommended, as it is faster and more secure than the older RSA standard.
# Generate a new SSH key
ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
# The above command will create two files:
# ~/.ssh/personal
# ~/.ssh/personal.pub
ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigOnce generated, copy the contents of the public key file (usually ending in .pub) to your clipboard. Then, log into the corresponding GitHub account and paste the key into your settings at https://github.com/settings/keys.
Check out the official GitHub documentation for more detailed instructions.
The SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
# Add the SSH key to the SSH agent
# macOS
ssh-add -K ~/.ssh/personal
ssh-add -K ~/.ssh/work
ssh-add -K ~/.ssh/sidegig
# Linux
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/personal
ssh-add ~/.ssh/work
ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
Now that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
# ~/.ssh/config
Host github
HostName github.com # Default
User git
IdentityFile ~/.ssh/personal
IdentitiesOnly no
Host github-work # This is an alias for your work account
HostName github.com
User git
IdentityFile ~/.ssh/work
IdentitiesOnly yes
Host github-sidegig # This is an alias for your side project
HostName github.com
User git
IdentityFile ~/.ssh/sidegig
IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
Now that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
# ~/.gitconfig__work
[user]
email = san-siva@work.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# Add these lines to your work config
[url "git@github-work:"]
insteadOf = git@github.com:# ~/.gitconfig__sidegig
[user]
email = san-siva@sidegig.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# Add these lines to your sidegig config
[url "git@github-sidegig:"]
insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
Verify that SSH is authenticating with the correct account for each alias:
# Test the setup
ssh -T git@github # Default, you should see the username linked to your personal github account
ssh -T git@github-work
ssh -T git@github-sidegigIf you see the right username for each, you're good to go.
With this setup in place, you never have to worry about mixing up your Git identities again. Your commits will automatically be authored with the correct email, and your code will be pushed using the right SSH key based entirely on the folder you are working in.
The key insight here is the separation of concerns: Git configs handle identity, and SSH configs handle access. Set it up once, and it all just works seamlessly in the background!
By default, Git uses a single global identity — one name, one email, and one SSH key. When you have multiple GitHub accounts (e.g. a personal account and a work account), every repo on your machine will commit under the same identity, and SSH will always try the same key regardless of which account you need.
You wouldn't want to accidentally commit to an open-source repository with your work email, or vice versa.
Organize your workspaces in a way that makes sense to you. This way you will always, know which git config you need to use for which repo, based on your working path.
1# Organize your workspaces
2.
3├── opensource # Open-source projects should use san-siva@gmail.com
4├── sidegig # Side Projects, should use san-siva@sidegig.com
5└── work # Personal projects, should use san-siva@work.com
6Start by configuring your global ~/.gitconfig file. It should contain your primary name and email address, acting as the default fallback identity for any repository outside your specialized workspaces.
# ~/.gitconfig
[user]
email = san-siva@gmail.com
name = Santhosh Siva
[pull]
rebase = false # set this to true if you want to rebase instead of merge
[submodule]
recurse = true # optional, if you are dealing with monorepos
Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
# ~/.gitconfig__work
[user]
email = san-siva@work.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# ~/.gitconfig__sidegig
[user]
email = san-siva@sidegig.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
# ~/.gitconfig
[user]
email = san-siva@gmail.com
name = Santhosh Siva
[pull]
rebase = false # set this to true if you want to rebase instead of merge
[submodule]
recurse = true # optional, if you are dealing with monorepos
# Add these lines to your global config
[includeIf "gitdir:/Users/san.siva/work/"]
path = ~/.gitconfig__work
[includeIf "gitdir:/Users/san.siva/sidegig/"]
path = ~/.gitconfig__sidegig
For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
Organize your workspaces in a way that makes sense to you. This way you will always, know which git config you need to use for which repo, based on your working path.
1# Organize your workspaces
2.
3├── opensource # Open-source projects should use san-siva@gmail.com
4├── sidegig # Side Projects, should use san-siva@sidegig.com
5└── work # Personal projects, should use san-siva@work.com
61# Organize your workspaces
2.
3├── opensource # Open-source projects should use san-siva@gmail.com
4├── sidegig # Side Projects, should use san-siva@sidegig.com
5└── work # Personal projects, should use san-siva@work.com
6Start by configuring your global ~/.gitconfig file. It should contain your primary name and email address, acting as the default fallback identity for any repository outside your specialized workspaces.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
91# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
15For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
15Start by creating a dedicated SSH key for each of your GitHub accounts. Using the ed25519 algorithm is highly recommended, as it is faster and more secure than the older RSA standard.
# Generate a new SSH key
ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
# The above command will create two files:
# ~/.ssh/personal
# ~/.ssh/personal.pub
ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigOnce generated, copy the contents of the public key file (usually ending in .pub) to your clipboard. Then, log into the corresponding GitHub account and paste the key into your settings at https://github.com/settings/keys.
Check out the official GitHub documentation for more detailed instructions.
The SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
# Add the SSH key to the SSH agent
# macOS
ssh-add -K ~/.ssh/personal
ssh-add -K ~/.ssh/work
ssh-add -K ~/.ssh/sidegig
# Linux
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/personal
ssh-add ~/.ssh/work
ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
Now that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
# ~/.ssh/config
Host github
HostName github.com # Default
User git
IdentityFile ~/.ssh/personal
IdentitiesOnly no
Host github-work # This is an alias for your work account
HostName github.com
User git
IdentityFile ~/.ssh/work
IdentitiesOnly yes
Host github-sidegig # This is an alias for your side project
HostName github.com
User git
IdentityFile ~/.ssh/sidegig
IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
Now that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
# ~/.gitconfig__work
[user]
email = san-siva@work.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# Add these lines to your work config
[url "git@github-work:"]
insteadOf = git@github.com:# ~/.gitconfig__sidegig
[user]
email = san-siva@sidegig.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# Add these lines to your sidegig config
[url "git@github-sidegig:"]
insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
Verify that SSH is authenticating with the correct account for each alias:
# Test the setup
ssh -T git@github # Default, you should see the username linked to your personal github account
ssh -T git@github-work
ssh -T git@github-sidegigIf you see the right username for each, you're good to go.
Start by creating a dedicated SSH key for each of your GitHub accounts. Using the ed25519 algorithm is highly recommended, as it is faster and more secure than the older RSA standard.
1# Generate a new SSH key
2
3ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
4# The above command will create two files:
5# ~/.ssh/personal
6# ~/.ssh/personal.pub
7
8ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
9ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegig1# Generate a new SSH key
2
3ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
4# The above command will create two files:
5# ~/.ssh/personal
6# ~/.ssh/personal.pub
7
8ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
9ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigOnce generated, copy the contents of the public key file (usually ending in .pub) to your clipboard. Then, log into the corresponding GitHub account and paste the key into your settings at https://github.com/settings/keys.
Check out the official GitHub documentation for more detailed instructions.
The SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigNow that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesNow that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:Verify that SSH is authenticating with the correct account for each alias:
1# Test the setup
2ssh -T git@github # Default, you should see the username linked to your personal github account
3ssh -T git@github-work
4ssh -T git@github-sidegigIf you see the right username for each, you're good to go.
1# Test the setup
2ssh -T git@github # Default, you should see the username linked to your personal github account
3ssh -T git@github-work
4ssh -T git@github-sidegigWith this setup in place, you never have to worry about mixing up your Git identities again. Your commits will automatically be authored with the correct email, and your code will be pushed using the right SSH key based entirely on the folder you are working in.
The key insight here is the separation of concerns: Git configs handle identity, and SSH configs handle access. Set it up once, and it all just works seamlessly in the background!
By default, Git uses a single global identity — one name, one email, and one SSH key. When you have multiple GitHub accounts (e.g. a personal account and a work account), every repo on your machine will commit under the same identity, and SSH will always try the same key regardless of which account you need.
You wouldn't want to accidentally commit to an open-source repository with your work email, or vice versa.
Organize your workspaces in a way that makes sense to you. This way you will always, know which git config you need to use for which repo, based on your working path.
1# Organize your workspaces
2.
3├── opensource # Open-source projects should use san-siva@gmail.com
4├── sidegig # Side Projects, should use san-siva@sidegig.com
5└── work # Personal projects, should use san-siva@work.com
6Start by configuring your global ~/.gitconfig file. It should contain your primary name and email address, acting as the default fallback identity for any repository outside your specialized workspaces.
# ~/.gitconfig
[user]
email = san-siva@gmail.com
name = Santhosh Siva
[pull]
rebase = false # set this to true if you want to rebase instead of merge
[submodule]
recurse = true # optional, if you are dealing with monorepos
Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
# ~/.gitconfig__work
[user]
email = san-siva@work.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# ~/.gitconfig__sidegig
[user]
email = san-siva@sidegig.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
# ~/.gitconfig
[user]
email = san-siva@gmail.com
name = Santhosh Siva
[pull]
rebase = false # set this to true if you want to rebase instead of merge
[submodule]
recurse = true # optional, if you are dealing with monorepos
# Add these lines to your global config
[includeIf "gitdir:/Users/san.siva/work/"]
path = ~/.gitconfig__work
[includeIf "gitdir:/Users/san.siva/sidegig/"]
path = ~/.gitconfig__sidegig
For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
Organize your workspaces in a way that makes sense to you. This way you will always, know which git config you need to use for which repo, based on your working path.
1# Organize your workspaces
2.
3├── opensource # Open-source projects should use san-siva@gmail.com
4├── sidegig # Side Projects, should use san-siva@sidegig.com
5└── work # Personal projects, should use san-siva@work.com
61# Organize your workspaces
2.
3├── opensource # Open-source projects should use san-siva@gmail.com
4├── sidegig # Side Projects, should use san-siva@sidegig.com
5└── work # Personal projects, should use san-siva@work.com
6Start by configuring your global ~/.gitconfig file. It should contain your primary name and email address, acting as the default fallback identity for any repository outside your specialized workspaces.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
91# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
15For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
15Start by creating a dedicated SSH key for each of your GitHub accounts. Using the ed25519 algorithm is highly recommended, as it is faster and more secure than the older RSA standard.
# Generate a new SSH key
ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
# The above command will create two files:
# ~/.ssh/personal
# ~/.ssh/personal.pub
ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigOnce generated, copy the contents of the public key file (usually ending in .pub) to your clipboard. Then, log into the corresponding GitHub account and paste the key into your settings at https://github.com/settings/keys.
Check out the official GitHub documentation for more detailed instructions.
The SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
# Add the SSH key to the SSH agent
# macOS
ssh-add -K ~/.ssh/personal
ssh-add -K ~/.ssh/work
ssh-add -K ~/.ssh/sidegig
# Linux
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/personal
ssh-add ~/.ssh/work
ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
Now that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
# ~/.ssh/config
Host github
HostName github.com # Default
User git
IdentityFile ~/.ssh/personal
IdentitiesOnly no
Host github-work # This is an alias for your work account
HostName github.com
User git
IdentityFile ~/.ssh/work
IdentitiesOnly yes
Host github-sidegig # This is an alias for your side project
HostName github.com
User git
IdentityFile ~/.ssh/sidegig
IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
Now that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
# ~/.gitconfig__work
[user]
email = san-siva@work.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# Add these lines to your work config
[url "git@github-work:"]
insteadOf = git@github.com:# ~/.gitconfig__sidegig
[user]
email = san-siva@sidegig.com
name = Santhosh Siva
[pull]
rebase = false
[submodule]
recurse = true
# Add these lines to your sidegig config
[url "git@github-sidegig:"]
insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
Verify that SSH is authenticating with the correct account for each alias:
# Test the setup
ssh -T git@github # Default, you should see the username linked to your personal github account
ssh -T git@github-work
ssh -T git@github-sidegigIf you see the right username for each, you're good to go.
Start by creating a dedicated SSH key for each of your GitHub accounts. Using the ed25519 algorithm is highly recommended, as it is faster and more secure than the older RSA standard.
1# Generate a new SSH key
2
3ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
4# The above command will create two files:
5# ~/.ssh/personal
6# ~/.ssh/personal.pub
7
8ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
9ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegig1# Generate a new SSH key
2
3ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
4# The above command will create two files:
5# ~/.ssh/personal
6# ~/.ssh/personal.pub
7
8ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
9ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigOnce generated, copy the contents of the public key file (usually ending in .pub) to your clipboard. Then, log into the corresponding GitHub account and paste the key into your settings at https://github.com/settings/keys.
Check out the official GitHub documentation for more detailed instructions.
The SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigNow that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesNow that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:Verify that SSH is authenticating with the correct account for each alias:
1# Test the setup
2ssh -T git@github # Default, you should see the username linked to your personal github account
3ssh -T git@github-work
4ssh -T git@github-sidegigIf you see the right username for each, you're good to go.
1# Test the setup
2ssh -T git@github # Default, you should see the username linked to your personal github account
3ssh -T git@github-work
4ssh -T git@github-sidegigWith this setup in place, you never have to worry about mixing up your Git identities again. Your commits will automatically be authored with the correct email, and your code will be pushed using the right SSH key based entirely on the folder you are working in.
The key insight here is the separation of concerns: Git configs handle identity, and SSH configs handle access. Set it up once, and it all just works seamlessly in the background!
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
15For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
151# Generate a new SSH key
2
3ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
4# The above command will create two files:
5# ~/.ssh/personal
6# ~/.ssh/personal.pub
7
8ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
9ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigThe SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigNow that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesNow that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:1# Test the setup
2ssh -T git@github # Default, you should see the username linked to your personal github account
3ssh -T git@github-work
4ssh -T git@github-sidegig1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9Next, create a dedicated Git configuration file for each workspace. This file will dictate the specific identity you want to use for that particular directory.
For example, I created ~/.gitconfig__work for my work-related projects, and ~/.gitconfig__sidegig for my side projects.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Since my global ~/.gitconfig file already acts as the default identity for the rest of my system, and I use my personal email for open-source commits, I don't need to create a separate config for those.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
91# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9Now you need to let Git know which config file to use for which directory. This is done using the includeIf directive in ~/.gitconfig.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
15For example, if I edit ~/work/react/app/package.json, Git will author my commits using san-siva@work.com. This happens because the includeIf "gitdir:/Users/san.siva/work/" directive detects that the repository is inside the work directory and automatically applies the settings from ~/.gitconfig__work.
1# ~/.gitconfig
2[user]
3 email = san-siva@gmail.com
4 name = Santhosh Siva
5[pull]
6 rebase = false # set this to true if you want to rebase instead of merge
7[submodule]
8 recurse = true # optional, if you are dealing with monorepos
9
10# Add these lines to your global config
11[includeIf "gitdir:/Users/san.siva/work/"]
12 path = ~/.gitconfig__work
13[includeIf "gitdir:/Users/san.siva/sidegig/"]
14 path = ~/.gitconfig__sidegig
151# Generate a new SSH key
2
3ssh-keygen -t ed25519 -C "san-siva@gmail.com" -f ~/.ssh/personal
4# The above command will create two files:
5# ~/.ssh/personal
6# ~/.ssh/personal.pub
7
8ssh-keygen -t ed25519 -C "san-siva@work.com" -f ~/.ssh/work
9ssh-keygen -t ed25519 -C "san-siva@sidegig.com" -f ~/.ssh/sidegigThe SSH agent is a program that manages your SSH keys, allowing you to authenticate with GitHub without having to enter your password every time.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigOn macOS, add UseKeychain yes and AddKeysToAgent yes to your ~/.ssh/config to have your keys persist across reboots automatically.
1# Add the SSH key to the SSH agent
2
3# macOS
4ssh-add -K ~/.ssh/personal
5ssh-add -K ~/.ssh/work
6ssh-add -K ~/.ssh/sidegig
7
8# Linux
9eval "$(ssh-agent -s)"
10ssh-add ~/.ssh/personal
11ssh-add ~/.ssh/work
12ssh-add ~/.ssh/sidegigNow that you have your SSH keys set up, you need to update your ~/.ssh/config file to use the correct key for each alias.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesHere is the best part: because of the insteadOf directive in our conditionally loaded workspace configs, you don't even need to change your clone URLs! You can continue using standard git@github.com links, and Git will automatically swap in github-work or github-sidegig behind the scenes to trigger the correct SSH key.
1# ~/.ssh/config
2
3Host github
4 HostName github.com # Default
5 User git
6 IdentityFile ~/.ssh/personal
7 IdentitiesOnly no
8
9Host github-work # This is an alias for your work account
10 HostName github.com
11 User git
12 IdentityFile ~/.ssh/work
13 IdentitiesOnly yes
14
15Host github-sidegig # This is an alias for your side project
16 HostName github.com
17 User git
18 IdentityFile ~/.ssh/sidegig
19 IdentitiesOnly yesNow that you have your SSH keys set up, you need to update your ~/.gitconfig file to use the correct alias for each directory.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:This tells Git to use the ~/.ssh/work key for your work directory, and the ~/.ssh/sidegig key for your side project.
1# ~/.gitconfig__work
2[user]
3 email = san-siva@work.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your work config
11[url "git@github-work:"]
12 insteadOf = git@github.com:1# ~/.gitconfig__sidegig
2[user]
3 email = san-siva@sidegig.com
4 name = Santhosh Siva
5[pull]
6 rebase = false
7[submodule]
8 recurse = true
9
10# Add these lines to your sidegig config
11[url "git@github-sidegig:"]
12 insteadOf = git@github.com:1# Test the setup
2ssh -T git@github # Default, you should see the username linked to your personal github account
3ssh -T git@github-work
4ssh -T git@github-sidegig