使用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)