Git clone only works with ssh://git@.. and not with git@
Any idea why a GIT repo would work only when using ssh://[email protected]/repo.git
and not also when using [email protected]/repo.git
?
It's a server setup by someone else so no idea how it was setup but on BitBucket or GitHub I can just use [email protected]/repo.git
and it works and clones the repo using SSH protocol. Any idea why for this server iy only works when using ssh://[email protected]/repo.git
?
So i need to add the ssh://
in front.
Solution 1:
You are using the incorrect syntax.
When you remove the scheme://
prefix, git no longer interprets your address in URL style anymore, but instead as rcp/scp style. But for rcp/scp style addresses, the path must be separated from user@host using a colon :
(specifying a port is not supported). For example:
git clone [email protected]:repo.git
git clone [email protected]:daniels/example.git
Without the colon, git will only interpret the address as a local path.
(You can see more details in the git clone or git fetch manual page.)