我工作过GIT克隆与ANT.I帮助我使用下面的代码吧:克隆Git仓库通过ANT
<target name ="deploy">
<sshexec host="ssh://[email protected]_location/project_name.git"
username="username"
password=""
passphrase="passphrase"
trust="true"
command="git clone ssh://[email protected]_location/project_name.git D:/dest"/
/>
</target>
位置“D:/dest
”是所需的文件夹,我想我的仓库克隆。但它报错为unknown host exception
。
我尝试了一些像主机ssh://[email protected]_location
几个组合,但它也返回服务器连接超时。
我们需要在结帐时提供密码。 该命令适用于GIT BASH
。
你好VonC,我纠正了一下我的代码。主机是不正确的。这次我只是通过“存储位置”来代替“ssh://[email protected]_location/project_name.git”。通过这样做,它能够连接到存储库...但仍然抛出此错误“SSH_MSG_DISCONNECT:2用户名认证失败太多”。我正在传递正确的凭据,但仍然存在错误。 –
@Narendra和'ssh -Tvvv user @ rep_location'返回什么? – VonC
它要求输入密码。我做了,但是显示认证失败。它向git存储库发送了一个密码包,但它返回了“Permission denied,Please try again”。并且三次尝试失败。 –