Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9217

How do I clone from local git repositories with ssh?

$
0
0

The final goal is to host a remote repo on my pc that support pushing and pulling.

From the official doc given by git help clone, the host url format should be

git clone ssh://user@localhost:/C:/path/to/repo

or

git clone git://localhost:/C:/path/to/repo

Git clone ssh returned

fatal: ''/C:/path/to/repo'' does not appear to be a git repository

While git clone git returned

fatal: unable to connect to localhost:localhost[0: ::1]: errno=Unknown errorlocalhost[1: 127.0.0.1]: errno=Unknown error

The repo is default repo without the --bare flag, but i think that should not affect cloning but pushing to master right?

The repo have existing commits

Ive tried localhost/C/ (without :) and path/to/repo.git but to no luck

I saw guides that suggests git@localhost but that doesnt make any sense, i supposed they forgot to mention its for github and gitlab or sth, so i didnt paid much attention to that

For my ssh setup, i have a ed25519 and rsa 4096 bit key pairs, with private key registered to my identity with ssh-add and public key copied to authorized_keys under ~/.ssh/ (and restarted) sshd

ssh user@localhost will bring me into the ssh shell as expected

The sshd_config file was not modified much, but for the sake of troubleshooting i reset it to sshd_config_default

The permissions are also fine, checked with the perm fix scripts which came along with the windows openssh package

Path is configured correctly for the custom openssh ssh file instead of the window's one

cloning from github with pubkey auth work fineso i assume its a problem in the host side

And GIT_SSH=/path/to/ssh.exe, GIT_SSH_COMMAND=ssh

oh and scp works perfectly fineon directories

I might be missing something in the docs, is there anything else that need to be configured before ssh clone can be used? Thanks

Windows 11 Pro 23H2OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2git version 2.45.0.windows.1


Viewing all articles
Browse latest Browse all 9217

Trending Articles