i'm trying to write a buildfile with phing and the GitCloneTask (to clone a repo from github), but i keep getting this message everytime i run phing:
The remote end hung up unexpectedly
So i checked if i could clone the repo with git-clone => works just fine;
checked my .gitconfig for an error with the Github API Token & Username => no typos or something
checked all repo-urls provided on github (ssh, https, read-only) => none of them changes the message when used in the buildfile
any ideas?
here's the code of the buildfile:
<?xml version="1.0" encoding="UTF-8"?>
<project name="ort" default="init">
<!-- ============================================ -->
<!-- Target: initialize -->
<!-- ============================================ -->
<target name="init">
<input propertyname="local.documentRoot">Where to put the files?:</input>
<mkdir dir="${local.documentRoot}" />
<gitclone
repository="git://github.com/pappelt/oil-resistance-test.git"
targetPath="${local.documentRoot}" />
</target>
</project>
I did some debugging in the phing class and I think the issue is that you need to specify the path/name of your git binary in the "gitPath" attribute.
I think on Linux is might be something like "/usr/lib/git", I'm running windows and simply used "git"
<target name="gitclone">
<echo msg="Getting latest code from ${git.repo}" />
<gitclone gitPath="git" repository="${git.repo}" targetPath="${build.dir}" />
</target>
This worked because my git binary (C:\Program Files\Git\cmd) is in my windows PATH...i.e. I can open a command prompt and type "git" and windows will know where it is.
Annoyingly I am cloning a private repo which requires me to enter a passphrase as well -_-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With