public abstract class GitUtils extends Object
| Constructor and Description |
|---|
GitUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
add(org.eclipse.jgit.api.Git repo,
String filepattern) |
static void |
addAll(org.eclipse.jgit.api.Git repo) |
static org.eclipse.jgit.lib.Ref |
checkout(org.eclipse.jgit.api.Git git,
org.eclipse.jgit.lib.Ref localRef,
boolean createBranch,
org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode mode,
boolean force) |
static org.eclipse.jgit.lib.Ref |
checkout(org.eclipse.jgit.api.Git git,
String remote,
boolean createBranch,
org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode mode,
boolean force) |
static void |
cherryPick(org.eclipse.jgit.api.Git repo,
org.eclipse.jgit.lib.Ref commit) |
static void |
close(org.eclipse.jgit.api.Git repo) |
static void |
commit(org.eclipse.jgit.api.Git repo,
String message) |
static void |
commitAll(org.eclipse.jgit.api.Git repo,
String message) |
static org.eclipse.jgit.lib.Ref |
createBranch(org.eclipse.jgit.api.Git git,
String branchName) |
static org.eclipse.jgit.transport.FetchResult |
fetch(org.eclipse.jgit.api.Git git,
String remote,
String refSpec,
int timeout,
boolean fsck,
boolean dryRun,
boolean thin,
boolean prune) |
static String |
getCurrentBranchName(org.eclipse.jgit.api.Git repo) |
static List<org.eclipse.jgit.lib.Ref> |
getLocalBranches(org.eclipse.jgit.api.Git repo) |
static Iterable<org.eclipse.jgit.revwalk.RevCommit> |
getLogForBranch(org.eclipse.jgit.api.Git repo,
String branchName) |
static List<String> |
getLogForCurrentBranch(org.eclipse.jgit.api.Git repo) |
static List<org.eclipse.jgit.lib.Ref> |
getRemoteBranches(org.eclipse.jgit.api.Git repo) |
static org.eclipse.jgit.api.Git |
git(File dir) |
static org.eclipse.jgit.api.Git |
init(File dir)
Initialize a new git repository.
|
static org.eclipse.jgit.api.PullResult |
pull(org.eclipse.jgit.api.Git git,
int timeout) |
static void |
resetHard(org.eclipse.jgit.api.Git repo,
String newBase) |
static void |
stashApply(org.eclipse.jgit.api.Git repo,
String... stashRef) |
static void |
stashCreate(org.eclipse.jgit.api.Git repo) |
static void |
stashDrop(org.eclipse.jgit.api.Git repo) |
static org.eclipse.jgit.lib.Ref |
switchBranch(org.eclipse.jgit.api.Git repo,
String branchName) |
public static org.eclipse.jgit.api.Git git(File dir) throws IOException
IOExceptionpublic static org.eclipse.jgit.lib.Ref checkout(org.eclipse.jgit.api.Git git,
String remote,
boolean createBranch,
org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode mode,
boolean force)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.lib.Ref checkout(org.eclipse.jgit.api.Git git,
org.eclipse.jgit.lib.Ref localRef,
boolean createBranch,
org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode mode,
boolean force)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.transport.FetchResult fetch(org.eclipse.jgit.api.Git git,
String remote,
String refSpec,
int timeout,
boolean fsck,
boolean dryRun,
boolean thin,
boolean prune)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git init(File dir) throws IOException
dir - The directory in which to create a new .git/ folder and repository.IOExceptionpublic static org.eclipse.jgit.api.PullResult pull(org.eclipse.jgit.api.Git git,
int timeout)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static List<org.eclipse.jgit.lib.Ref> getRemoteBranches(org.eclipse.jgit.api.Git repo) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static List<org.eclipse.jgit.lib.Ref> getLocalBranches(org.eclipse.jgit.api.Git repo) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static String getCurrentBranchName(org.eclipse.jgit.api.Git repo) throws IOException
IOExceptionpublic static org.eclipse.jgit.lib.Ref switchBranch(org.eclipse.jgit.api.Git repo,
String branchName)
public static List<String> getLogForCurrentBranch(org.eclipse.jgit.api.Git repo) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static Iterable<org.eclipse.jgit.revwalk.RevCommit> getLogForBranch(org.eclipse.jgit.api.Git repo, String branchName) throws org.eclipse.jgit.api.errors.GitAPIException, IOException
org.eclipse.jgit.api.errors.GitAPIExceptionIOExceptionpublic static void add(org.eclipse.jgit.api.Git repo,
String filepattern)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void addAll(org.eclipse.jgit.api.Git repo)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void commit(org.eclipse.jgit.api.Git repo,
String message)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void commitAll(org.eclipse.jgit.api.Git repo,
String message)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void stashCreate(org.eclipse.jgit.api.Git repo)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void stashApply(org.eclipse.jgit.api.Git repo,
String... stashRef)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void stashDrop(org.eclipse.jgit.api.Git repo)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void cherryPick(org.eclipse.jgit.api.Git repo,
org.eclipse.jgit.lib.Ref commit)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static void resetHard(org.eclipse.jgit.api.Git repo,
String newBase)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.lib.Ref createBranch(org.eclipse.jgit.api.Git git,
String branchName)
throws org.eclipse.jgit.api.errors.RefAlreadyExistsException,
org.eclipse.jgit.api.errors.RefNotFoundException,
org.eclipse.jgit.api.errors.InvalidRefNameException,
org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.RefAlreadyExistsExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.InvalidRefNameExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static void close(org.eclipse.jgit.api.Git repo)
Copyright © 2013 OCPsoft. All Rights Reserved.