ant

Ant Tasks for Git

Get started:

<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>
<macrodef name = "git-clone-pull">
    <attribute name = "repository" />
    <attribute name = "dest" />
    <sequential>
        <git command = "clone">
            <args>
                <arg value = "@{repository}" />
                <arg value = "@{dest}" />
            </args>
        </git>
        <git command = "pull" dir = "@{dest}" />
    </sequential>
</macrodef>

Clone

<git command="clone">
    <args>
        <arg value = "-v" />
        <arg value = "git@YOURGITURL:GITUSER/GITREPO" />
        <arg value = "repo" />
    </args>
</git>

Pull

<git command = "pull" dir = "repository_path" />

Add / Commit / Push

<input message="Commit message" addproperty="commit-message" />
<git command="add">
    <args>
                    <arg value="." />
    </args>
</git>
<git command="commit">
    <args>
                    <arg value="-am ${commit-message}" />
    </args>
</git>
<git command="push" />

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow