org.mule.modules

mule-module-git

2.1
Namespacehttp://www.mulesoft.org/schema/mule/git
Schema Locationhttp://www.mulesoft.org/schema/mule/git/2.0/mule-git.xsd
Version2.0
Minimum Mule Version3.2

Module Overview


GitConnector is a Cloud Connector Facade for GIT SCM. It allows to

  • clone repositories
  • create and delete branches
  • push, pull and fetch repositories
  • checkout branches, tags and revisions
  • commit revisions

Summary

Configuration
<git:config>
Configure an instance of this module
Message Processors
<git:add>
Add file contents to the index
<git:checkout>
Checkout a local branch or create a local branch from a remote branch
or
<git:clone>
Clone a repository into a new directory
<git:commit>
Record changes to the repository
<git:create-branch>
Create a local branch
<git:delete-branch>
Delete local branch
<git:fetch>
Fetch changes from another repository
<git:pull>
Fetch from and merge with another repository or a local branch
<git:push>
Update remote refs along with associated objects

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:git="http://www.mulesoft.org/schema/mule/git"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/git
               http://www.mulesoft.org/schema/mule/git/2.0/mule-git.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necesary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescription
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:string directory Directory of your git repository

Message Processors

<git:add>

Add file contents to the index

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
filePattern File to add content from. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively.
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:checkout>

Checkout a local branch or create a local branch from a remote branch

XML Sample
INCLUDE_ERROR
or
XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
branch Name of the branch to checkout
startPoint Optional. If specified creates a new branch pointing to this startPoint
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:clone>

Clone a repository into a new directory

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
uri The (possibly remote) repository to clone from.
bare Optional. True if you want a bare Git repository, false otherwise.
remote Optional. Name of the remote to keep track of the upstream repository.
branch Optional. Name of the local branch into which the remote will be cloned.
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:commit>

Record changes to the repository

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
msg Commit message
committerName Name of the person performing this commit
committerEmail Email of the person performing this commit
authorName Optional. Name of the author of the changes to commit
authorEmail Optional. Email of the author of the changes to commit
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:create-branch>

Create a local branch

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
name Name of the new branch
force Optional. If true and the branch with the given name already exists, the start-point of an existing branch will be set to a new start-point; if false, the existing branch will not be changed.
startPoint Optional. The new branch head will point to this commit. It may be given as a branch name, a commit-id, or a tag. If this option is omitted, the current HEAD will be used instead.
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:delete-branch>

Delete local branch

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
name Name of the branch to delete
force If false a check will be performed whether the branch to be deleted is already merged into the current branch and deletion will be refused in this case
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:fetch>

Fetch changes from another repository

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:pull>

Fetch from and merge with another repository or a local branch

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements

<git:push>

Update remote refs along with associated objects

XML Sample
INCLUDE_ERROR

Attributes
config-ref Optional. Specify which configuration to use.
remote Optional. The remote (uri or name) used for the push operation.
force Optional. Sets the force preference for push operation
overrideDirectory Optional. Name of the directory to use for git repository
retryMax 1 Optional. Specify how many times this operation can be retried automatically
Child Elements