rimerosolutions / ant-git-tasks

Ant tasks for Git with JGit
Apache License 2.0
41 stars 39 forks source link

Allow creating a branch from a custom origin. #6

Closed yveszoundi closed 9 years ago

yveszoundi commented 9 years ago

From email:

I have a real quick question regarding how to checkout branch tags from an exisiting repository using your custom ant task.

<git:git directory="${library.directory}" verbose="true" settingsRef="git.refID">
  <git:clone uri="<url>.git"/>
  <git:checkout branchName="origin/master" createBranch="true"/>
</git:git>

From reading the wiki this seems to be correct for checking out a remote branch, but I need to be able to checkout a particular branch tag.

Answer/Possible workaround: I think that I should expose the setStartPoint method from JGit: http://download.eclipse.org/jgit/docs/jgit-2.3.1.201302201838-r/apidocs/org/eclipse/jgit/api/CheckoutCommand.html#setStartPoint(java.lang.String)

Alternatively, you should be might able to get away with it by doing the following:

<git:git ...>
  <git checkout yourtag/>
 <git checkout your branch create=true/>
   </git:git>
yveszoundi commented 9 years ago

Added startPoint attribute to git:checkout. This should allow specifying a custom tag.