Git Module

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.

Parameter Type Description
repository java.lang.Object repository instance or location (local) to get status from
filepattern java.lang.String

Returns:org.eclipse.jgit.dircache.DirCache ... add result

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.

Parameter Type Description
remoteLocation java.lang.String location to fetch repository from
localLocation java.lang.Object local path to be used
user java.lang.String username for the remote repository
Optional: defaults to <null>.
pass java.lang.String password for the remote repository
Optional: defaults to <null>.
branch java.lang.String branch to checkout (null for all branches)
Optional: defaults to <null>.

Returns:org.eclipse.jgit.api.Git ... GIT API instance

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.

Parameter Type Description
repository java.lang.Object repository instance or location (local) to pull
message java.lang.String
author java.lang.String
amend boolean
Optional: defaults to <false>.

Returns:org.eclipse.jgit.revwalk.RevCommit ... commit result

getStatus

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

Get repository status.

Parameter Type Description
repository java.lang.Object repository instance or location (local) to get status from

Returns:org.eclipse.jgit.api.Status ... repository status

initRepository

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

Initialize a fresh repository.

Parameter Type Description
location java.lang.Object repository location
bare boolean true for bare repositories
Optional: defaults to <false>.

Returns:org.eclipse.jgit.api.Git ... GIT API instance

openRepository

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

Open a local repository.

Parameter Type Description
location java.lang.Object local repository root folder

Returns:org.eclipse.jgit.api.Git ... GIT API instance

pull

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

Pull a repository.

Parameter Type Description
repository java.lang.Object repository instance or location (local) to pull

Returns:org.eclipse.jgit.api.PullResult ... pull result

push

java.lang.Iterable push(java.lang.Object repository)

Push a repository.

Parameter Type Description
repository java.lang.Object repository instance or location (local) to pull

Returns:java.lang.Iterable ... push result