In preparation of what should have been a minor bug-fix release (2.4.3), me and Michiel have not only smashed bugs, but introduced quite a few features as well. The feature that I spend most of my time on was implementation of equal support for Git as we had for Subversion.
It’s been quite a lot of time from the first request by Steven Roussey to actually having GitTasks available in Phing. But finally we have them:
- GitInitTask
- GitGcTask
- GitCheckoutTask
- GitCloneTask
- GitBranchTask
- GitFetchTask
- GitMergeTask
- GitPullTask
- GitPushTask
I already planned enhancements, but these ones should get you up and running!
Although I have created those tasks from scratch, I should mention three persons without whose work this undertaking of mine wouldn’t be that interesting and rewarding: Kousuke Ebihara, Beau Simensen, and Zachary Danger.
Kousuke is the guy behind PEAR’s VersionControl_Git – which made it ridiculously easy to write git manipulating magic. Beau and Zach, beside creating custom git tasks to which I always turned for road-map and inspiration, also constantly pushed me forward, by providing feedback and asking when I will finally make GitTasks available to general public.
Thank you, guys, for your marvelous work!
I really hope that you will find those tasks helpful, and if you spot any issue you will make sure to hit me back, so that I can improve the code.
That’s all – wish you sane an non-broken builds!




Awesome, we use Phing heavily in conjunction with SVN, but have been looking to move to Git (to coincide with the move of Drupal contributions to git). Having this available makes that possible. Thanks for the good work.
Plans for GitCommitTask?
@Paul:
Well, honestly, I don’t see the use case for commit task. Still if you’ll let me know one, I will certainly look into that.
*hiya!*
how do I set a different path to git (when it’s not /usr/bin/git)?
I found a method setGitPath but it’s not used anywhere…
tia Wolfgang
There is a gitPath property for that (http://www.phing.info/docs/guide/trunk/chapters/appendixes/AppendixC-OptionalTasks.html#GitBranchTask).
eg:
<gitinitgitPath="/usr/local/bin/git"
repository="${repo.dir.resolved}" />
This should work!
Hi!
Why is a commit task useless? When working locally, git’s commit command is essential. Actually is what makes the version control thing… E. g. After passing tests properly, I would like to commit (and maybe push) and then deploy files in my local apache installation.
@jadianes
Well, git commit is nice, I just didn’t think anyone would want to automate such an essential thing as committing into repo – it is hard to automatically cherry-pick what file deltas to commit and what to ignore, thus potentially leading to files you’d never commit manually being committed.
Anyway, it seems you have a use case for GitCommit task. So, I added it to my todo list, and will look into it.