public class

GitConnector

extends Object
java.lang.Object
   ↳ org.mule.module.git.GitConnector
Known Direct Subclasses
Known Indirect Subclasses

Class 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

Fields
private String directory Directory of your git repository
Public Constructors
GitConnector()
Public Methods
void add(String filePattern, String overrideDirectory)
Add file contents to the index
void checkout(String branch, String startPoint, String overrideDirectory)
Checkout a local branch or create a local branch from a remote branch or
void cloneRepository(String uri, boolean bare, String remote, String branch, String overrideDirectory)
Clone a repository into a new directory
void commit(String msg, String committerName, String committerEmail, String authorName, String authorEmail, String overrideDirectory)
Record changes to the repository
void createBranch(String name, boolean force, String startPoint, String overrideDirectory)
Create a local branch
void deleteBranch(String name, boolean force, String overrideDirectory)
Delete local branch
void fetch(String overrideDirectory)
Fetch changes from another repository
String getDirectory()
void pull(String overrideDirectory)
Fetch from and merge with another repository or a local branch
void push(String remote, boolean force, String overrideDirectory)
Update remote refs along with associated objects
void setDirectory(String directory)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String directory

Directory of your git repository

Public Constructors

public GitConnector ()

Public Methods

public void add (String filePattern, String overrideDirectory)

Add file contents to the index

Parameters
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 Name of the directory to use for git repository

public void checkout (String branch, String startPoint, String overrideDirectory)

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

Parameters
branch Name of the branch to checkout
startPoint If specified creates a new branch pointing to this startPoint
overrideDirectory Name of the directory to use for git repository

public void cloneRepository (String uri, boolean bare, String remote, String branch, String overrideDirectory)

Clone a repository into a new directory

Parameters
uri The (possibly remote) repository to clone from.
bare True if you want a bare Git repository, false otherwise.
remote Name of the remote to keep track of the upstream repository.
branch Name of the local branch into which the remote will be cloned.
overrideDirectory Name of the directory to use for git repository

public void commit (String msg, String committerName, String committerEmail, String authorName, String authorEmail, String overrideDirectory)

Record changes to the repository

Parameters
msg Commit message
committerName Name of the person performing this commit
committerEmail Email of the person performing this commit
authorName Name of the author of the changes to commit
authorEmail Email of the author of the changes to commit
overrideDirectory Name of the directory to use for git repository

public void createBranch (String name, boolean force, String startPoint, String overrideDirectory)

Create a local branch

Parameters
name Name of the new branch
force 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 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 Name of the directory to use for git repository

public void deleteBranch (String name, boolean force, String overrideDirectory)

Delete local branch

Parameters
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 Name of the directory to use for git repository

public void fetch (String overrideDirectory)

Fetch changes from another repository

Parameters
overrideDirectory Name of the directory to use for git repository

public String getDirectory ()

public void pull (String overrideDirectory)

Fetch from and merge with another repository or a local branch

Parameters
overrideDirectory Name of the directory to use for git repository

public void push (String remote, boolean force, String overrideDirectory)

Update remote refs along with associated objects

Parameters
remote The remote (uri or name) used for the push operation.
force Sets the force preference for push operation
overrideDirectory Name of the directory to use for git repository

public void setDirectory (String directory)

Parameters
directory