Git Module

Provides functions to access and operate on git repositories through JGIT.

Method Overview

Method Description
add() Get repository status.
clone() Clone a git repository.
commit() Commit to a repository.
getStatus() Get repository status.
initRepository() Initialize a fresh repository.
openRepository() Open a local repository.
pull() Pull a repository.
push() Push a repository.

Methods

add

org.eclipse.jgit.dircache.DirCache add(java.lang.Object repository, java.lang.String filepattern)

Get repository status.

repository
repository instance or location (local) to get status from
filepattern

add result

IOException
GitAPIException

clone

org.eclipse.jgit.api.Git clone(java.lang.String remoteLocation, java.lang.Object localLocation, [java.lang.String user], [java.lang.String pass], [java.lang.String branch])

Clone a git repository.

remoteLocation
location to fetch repository from
localLocation
local path to be used
user
username for the remote repositoryOptional: defaults to <null>.
pass
password for the remote repositoryOptional: defaults to <null>.
branch
branch to checkout (null for all branches)Optional: defaults to <null>.

GIT API instance

InvalidRemoteException
when command was called with an invalid remote
TransportException
when transport operation failed
GitAPIException

commit

org.eclipse.jgit.revwalk.RevCommit commit(java.lang.Object repository, java.lang.String message, [java.lang.String author], [boolean amend])

Commit to a repository.

repository
repository instance or location (local) to pull
message
commit message
author
author to be used for the commit. Use format 'Real Name <email@address>'Optional: defaults to <null>.
amend
whether to amend the previous commitOptional: defaults to <false>.

commit result

IOException
the repository could not be accessed
GitAPIException

getStatus

org.eclipse.jgit.api.Status getStatus(java.lang.Object repository)

Get repository status.

repository
repository instance or location (local) to get status from

repository status

IOException
GitAPIException

initRepository

org.eclipse.jgit.api.Git initRepository(java.lang.Object location, [boolean bare])

Initialize a fresh repository.

location
repository location
bare
true for bare repositoriesOptional: defaults to <false>.

GIT API instance

IllegalStateException
GitAPIException

openRepository

org.eclipse.jgit.api.Git openRepository(java.lang.Object location)

Open a local repository.

location
local repository root folder

GIT API instance

IOException

pull

org.eclipse.jgit.api.PullResult pull(java.lang.Object repository)

Pull a repository.

repository
repository instance or location (local) to pull

pull result

IOException
GitAPIException

push

java.lang.Iterable<T> push(java.lang.Object repository)

Push a repository.

repository
repository instance or location (local) to pull

push result

IOException
GitAPIException