# Setting up Git in Powershell You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this: 1. Start the `ssh-agent` from Windows Services: ``` # By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work. # Make sure you're running as an Administrator. Get-Service ssh-agent | Set-Service -StartupType Automatic # Start the service Start-Service ssh-agent # This should return a status of Running Get-Service ssh-agent ``` 2. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell: ``` git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe ``` 3. Configure SSH to automatically add the keys to the agent on startup by editing the `config` file found at `$HOME\.ssh\config` (full path - `C:\Users\%YOUR_USERNAME%\.ssh\config`), and add the following lines: ``` Host * AddKeysToAgent yes IdentitiesOnly yes ``` You can also add the following lines if you generated an SSH key with custom name or multiple SSH keys: ``` Host github.com HostName github.com User your_user_name IdentityFile ~/.ssh/your_file_name ``` 4. Add your SSH key to the `ssh-agent` by issuing the `ssh-add` command and entering your passphrase: ``` ssh-add $HOME/.ssh/your_file_name ``` 5. Done! Now restart your Powershell and even Windows if necessary. --- ## 📚 References - <https://gist.github.com/danieldogeanu/16c61e9b80345c5837b9e5045a701c99>