0

I face problem while checking out the code from Git cloud repository.

Here is the ANT build code

  <project name="ProjectX" default="checkoutcode" basedir="."  xmlns:git="antlib:com.rimerosolutions.ant.git">
<taskdef uri="antlib:com.rimerosolutions.ant.git"
         resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml">
        <classpath>
            <pathelement location="./external-libs/org.eclipse.jgit.ant-3.0.0.201306101825-r.jar"/>
            <pathelement location="./external-libs/org.eclipse.jgit-3.0.0.201306101825-r.jar"/>
            <pathelement location="./external-libs/jsch-0.1.50.jar"/>
            <pathelement location="./external-libs/ant-git-tasks-0.0.1.jar"/>

       </classpath>
  </taskdef>

    <git:settings refId="git.testing"
        username="userx"
        password="passx"
        name="Rashmin"
        email="r@r.com"/>

    <target name="checkoutcode">
   <git:git directory="c:\documents\projectxsrcbuild" verbose="true" settingsRef="git.testing">
            <git:init uri="https://github.com/company/projectx.git" />
            <git:checkout branchname="development" />

        </git:git>
    </target>
     </project>

This is the result I get on console

Buildfile: C:\document\git\Platform\build\buildprojectx.xml

check:

init:
   [delete] Deleting directory c:\documents\projectxsrcbuild
    [mkdir] Created dir: c:\documents\projectxsrcbuild

checkoutcode:
[antlib:com.rimerosolutions.ant.git:checkout] The branch 'development' was not found.

Can any one help me?

Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79

1 Answers1

0

I'm more familiar with JGit which has an associated ant task.

Also available from Maven Central repository:

Not entirely clear what your ANT task is, although looking at the jar dependencies, looks like it too depends on JGit.

Examples of my ANT usage of JGit:

  1. How to tell ANT-exec, the location of git executable
  2. How can I get the latest commit ID of the currently checked out branch in git, using ANT, without having an active git installation?
Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Thanks for this! I tried using jGit, but if failed at connecting my repository. I mean failed at authentication. My Repo is HTTPS and requires authentication. – Rashmin H Gadhavi Feb 04 '15 at 18:13