Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Ant的Git推送_Git_Ant_Ssh_Git Push_Git Pull - Fatal编程技术网

使用Ant的Git推送

使用Ant的Git推送,git,ant,ssh,git-push,git-pull,Git,Ant,Ssh,Git Push,Git Pull,我正在尝试运行gitpushcommand而不需要使用clear Ant询问密码,但我仍然没有运气 我设法运行git status,git commit。原因很清楚-此命令不需要任何web访问。以下是我用于此命令的代码: <macrodef name="git"> <attribute name="command" /> <attribute name="dir" default="" /> <element name="args

我正在尝试运行
gitpush
command而不需要使用clear Ant询问密码,但我仍然没有运气

我设法运行
git status
git commit
。原因很清楚-此命令不需要任何web访问。以下是我用于此命令的代码:

<macrodef name="git">
    <attribute name="command" />
    <attribute name="dir" default="" />
    <element name="args" optional="true" />
    <sequential>
        <echo message="${git} @{command}" />
        <exec executable="${git}" dir="@{dir}">
            <arg value="@{command}" />
            <args/>
        </exec>
    </sequential>
</macrodef>


我想你忘了将公钥添加到Bitbucket中,请参见=>也许你的私钥是用密码短语加密的?@Rebse否,我添加了密钥(@Rebse Hm.它是用密码短语加密的,但它怎么能阻止连接?当我用gitbash加密它时,它会询问密码短语。如果你的私钥是用密码短语加密的,你必须提供密码,有关详细信息,请参阅和或搜索“无密码ssh”-你的操作系统是什么?
<target name="push_sshexec">
    <sshexec host="bitbucket.org"
             keyfile="${ssh.keyfile}"
             username="username"
             verbose="true"
             trust="true"
             command="${git}"/>
</target>
Authentications that can continue: publickey,keyboard-interactive,password Next authentication method: publickey Disconnecting from bitbucket.org port 22 *pathtoproject*\ant-for-git.xml:61: com.jcraft.jsch.JSchException: Auth fail at org.apache.tools.ant.taskdefs.optional.ssh.SSHExec.execute(SSHExec.java:218)