Skip to content

Instantly share code, notes, and snippets.

@kelsS
Last active July 20, 2017 17:13
Show Gist options
  • Save kelsS/5c2da324365d7c9480381c135ef889f7 to your computer and use it in GitHub Desktop.
Save kelsS/5c2da324365d7c9480381c135ef889f7 to your computer and use it in GitHub Desktop.
SSH on Windows

Kill all ssh-agents

taskkill /F /IM ssh-agent.exe /T
  • Run from Powershell

Add Git to PATH variable to use git from PS

  • From GUI
    • Open control panel
      • go to System and Security
        • System
          • Advanced System Settings
            • Environment Variables
  • Possible paths
    C:\Program Files (x86)\Git\bin\git.exe
    C:\Program Files (x86)\Git\bin\cmd

Stop using PuTTY in Git Bash

  • Add Git ssh.exe to GIT_SSH environment variable
  • Possible path
    C:\Program Files (x86)\Git\bin\usr\ssh.exe

Start Key Agent and add SSH keys in Git Bash

eval $(ssh-agent -s) && ssh-add "C:\Users\USERNAME\.ssh\KEY_NAME"

Improve Powershell and Git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment