我当前的命令是
git clone ssh://[email protected]/srv/git/repo
之后
password
...很好,效果很好。
现在,我想一行执行此操作。像这样:
git clone ssh://username:[email protected]/srv/git/repo
但它不起作用,并给我消息:
Please make sure you have the correct access rights and the repository exists.
如何在单行中克隆?
您应该可以使用http
url来克隆它:
git clone http://username:[email protected]/srv/git/repo.git
编辑:
如果万一只能使用用户名密码凭据通过ssh进行此操作,请尝试使用sshpass
like:
sshpass -p password git clone ssh://[email protected]/srv/git/repo
您可能需要为此安装sshpass
。
请注意,这是在未正确配置ssh密钥的情况下。如果配置了ssh密钥,则您的公钥将与目标服务器共享,并且您无需输入密码(不过,您可能必须输入密码)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句