I'm on Windows 10 and I have Git for Windows installed. I'm pushing code to two different GitHub accounts, and I'm trying to set up my SSH agent to use two keys (one for each account).
Here's my ~\.ssh\config:
Host github.com-userone
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github.com-usertwo
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_usertwo
It works correctly if I push/pull using Git Bash, but I want to be able to use Powershell also. When I try to do a push or pull from Powershell, I get the "please make sure you have the correct access rights" error. If I run start-ssh-agent.cmd from Powershell, then git push works for that instance of Powershell.
If I add start-ssh-agent.cmd to my profile.ps1 profile then the SSH agent starts and git push works correctly, but that seems to break other aspects of my Powershell profile (shown below). The Import-Module and Set-Theme no longer work. I don't get any errors; I just no longer get my posh-git or oh-my-git styling.
Import-Module oh-my-posh
Import-Module posh-git
Set-Theme Paradox
Set-Location "c:\users\brubin\documents\visual studio 2017\projects"
start-ssh-agent.cmd
Most of the instructions that I've found for getting this to work involve running eval $(ssh-agent -s), however eval doesn't work in Powershell.
How do I set this up so that I can push/pull from two different GitHub accounts using Powershell?