Skip to content

Instantly share code, notes, and snippets.

@bradobro
Last active July 23, 2018 17:04
Show Gist options
  • Save bradobro/beb0917866825491c11052edeea027be to your computer and use it in GitHub Desktop.
Save bradobro/beb0917866825491c11052edeea027be to your computer and use it in GitHub Desktop.
go get via ssh
# command-line version: git config --global --add 'url.git@github.com.insteadOf' 'https://github.com'
[url "git@github.com"] # this works on Linux
insteadOf = https://github.com
# Git for Windows (git version 2.18.0.windows.1) seems to do less magic with the substitution and needs:
[url "git@github.com:"] # Git for Windows (under MING) needs the trailing ":" here and the trailing "/" below.
insteadOf = https://github.com/
@bradobro
Copy link
Author

Windows also needs ssh-agent if your keys are password protected. This started shipping with Windows 10 in 2018.

Start the service ssh-agent from the an admin PowerShell (or OpenSSH Authentication Agent in the services UI).

From the thread on PowerShell/Win32-OpenSSH#224

1 . Check the current status of ssh-agent: "Get-Service | select -property name,starttype"
2. Set the new type : "Set-Service -Name ssh-agent -StartupType Manual"
3. Start it: "Start-Service ssh-agent"
4 Add simply your key as before: "ssh-add"

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