Multiple accounts

Assisted by google workspace - help me write.

To use multiple git accounts, you can use the .ssh/config file. This file stores your SSH configuration information, including your username, hostname, and port number for each account. You can then use this information to connect to your git repositories without having to enter your username and password each time.

To create a .ssh/config file, open a text editor and create a new file called .ssh/config in your home directory. Add the following lines to the file

Host my-first-account.

Hostname github.com.

User johndoe.

Port 22.

Host my-second-account.

Hostname bitbucket.org.

User janedoe.

Port 22.

Save the file and close the text editor. Then, open a terminal and run the following command

ssh -t my-first-account

This will connect you to your first git account. You can then use the git command-line tools to interact with your repository.

To connect to your second git account, run the following command

ssh -t my-second-account

You can also use the .ssh/config file to store other information, such as your SSH key fingerprint and the path to your private key. For more information, see the ssh_config man page.

In VScode.

if you get error. [email protected]: Permission denied (publickey).

Get-Service -Name ssh-agent | Set-Service -StartupType Manual
ssh-agent
ssh-add
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
Updated: 2026 Aug 19