Skip to content

Instantly share code, notes, and snippets.

@GrennKren
Last active July 19, 2024 08:13
Show Gist options
  • Save GrennKren/a724e2ff9d71a113d626bed0719c4cdb to your computer and use it in GitHub Desktop.
Save GrennKren/a724e2ff9d71a113d626bed0719c4cdb to your computer and use it in GitHub Desktop.
Handling git problem on Windows Server
client side:
generate key with:
ssh-keygen -i ed25519
take the content of id_ed25519.pub
and append it into authorized_keys (the path can be found in config)
server side:
check config
"C:\ProgramData\ssh\sshd_config"
for
PubkeyAuthentication
AuthorizedKeysFile
Client Side:
If you get the error message:
fatal: ''/D:/project/myrepo'' does not appear to be a git repository
when trying to clone a git repository via SSH using OpenSSH on a Windows Server, for example:
`$ git clone ssh://server_username@xx.xx.xx.xx:22110/D:/project/myrepo`
#####################################################################
Server side:
Make sure D:/project/myrepo has been initialized with `git init`, and change the default shell of OpenSSH from powershell to bash.exe, which comes with git-bash.
Open regedit
Go to `HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH` and add a new String Value C:\Program Files\Git\usr\bin\bash.exe without double quotes ' " '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment