public class GitUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEVELOP_BRANCH |
static String |
MASTER_BRANCH |
| Constructor and Description |
|---|
GitUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkoutRepoBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
CommandResult commandResult) |
static org.eclipse.jgit.api.Git |
cloneRepo(String sClonePath,
String sRepoURL,
CommandResult commandResult,
String strGitHubUserLogin,
String strUserName,
String strPassword) |
static void |
createLocalBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
CommandResult commandResult) |
static String |
getFileContent(String strFullName,
String strPathFile,
String strBranch,
String strUserName,
String strPassword) |
static org.eclipse.jgit.api.Git |
getGit(String strClonePath) |
static String |
getLastCommitId(org.eclipse.jgit.api.Git git) |
static String |
getLastLog(org.eclipse.jgit.api.Git git,
int nMaxCommit) |
static String |
getRefBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
CommandResult commandResult) |
static List<String> |
getTagNameList(org.eclipse.jgit.api.Git git) |
static org.eclipse.jgit.api.MergeResult |
mergeBack(org.eclipse.jgit.api.Git git,
String strUserName,
String strPassword,
CommandResult commandResult) |
static org.eclipse.jgit.api.MergeResult |
mergeRepoBranch(org.eclipse.jgit.api.Git git,
String strBranchToMerge) |
static org.eclipse.jgit.api.PullResult |
pullRepoBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
String strUserName,
String strPassword) |
static void |
pushForce(org.eclipse.jgit.api.Git git,
String strRefSpec,
String strUserName,
String strPassword) |
static GithubSearchResult |
searchRepo(String strSearch,
String strOrganization,
String strUserName,
String strPassword) |
public static final String MASTER_BRANCH
public static final String DEVELOP_BRANCH
public static org.eclipse.jgit.api.Git cloneRepo(String sClonePath, String sRepoURL, CommandResult commandResult, String strGitHubUserLogin, String strUserName, String strPassword)
public static void checkoutRepoBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
CommandResult commandResult)
public static void createLocalBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
CommandResult commandResult)
public static String getRefBranch(org.eclipse.jgit.api.Git git, String sBranchName, CommandResult commandResult)
public static void pushForce(org.eclipse.jgit.api.Git git,
String strRefSpec,
String strUserName,
String strPassword)
throws org.eclipse.jgit.api.errors.InvalidRemoteException,
org.eclipse.jgit.api.errors.TransportException,
org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.PullResult pullRepoBranch(org.eclipse.jgit.api.Git git,
String sBranchName,
String strUserName,
String strPassword)
throws IOException,
org.eclipse.jgit.api.errors.WrongRepositoryStateException,
org.eclipse.jgit.api.errors.InvalidConfigurationException,
org.eclipse.jgit.api.errors.DetachedHeadException,
org.eclipse.jgit.api.errors.InvalidRemoteException,
org.eclipse.jgit.api.errors.CanceledException,
org.eclipse.jgit.api.errors.RefNotFoundException,
org.eclipse.jgit.api.errors.NoHeadException,
org.eclipse.jgit.api.errors.TransportException,
org.eclipse.jgit.api.errors.GitAPIException
IOExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateExceptionorg.eclipse.jgit.api.errors.InvalidConfigurationExceptionorg.eclipse.jgit.api.errors.DetachedHeadExceptionorg.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.CanceledExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.MergeResult mergeRepoBranch(org.eclipse.jgit.api.Git git,
String strBranchToMerge)
throws IOException,
org.eclipse.jgit.api.errors.WrongRepositoryStateException,
org.eclipse.jgit.api.errors.InvalidConfigurationException,
org.eclipse.jgit.api.errors.DetachedHeadException,
org.eclipse.jgit.api.errors.InvalidRemoteException,
org.eclipse.jgit.api.errors.CanceledException,
org.eclipse.jgit.api.errors.RefNotFoundException,
org.eclipse.jgit.api.errors.NoHeadException,
org.eclipse.jgit.api.errors.TransportException,
org.eclipse.jgit.api.errors.GitAPIException
IOExceptionorg.eclipse.jgit.api.errors.WrongRepositoryStateExceptionorg.eclipse.jgit.api.errors.InvalidConfigurationExceptionorg.eclipse.jgit.api.errors.DetachedHeadExceptionorg.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.CanceledExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static String getLastLog(org.eclipse.jgit.api.Git git, int nMaxCommit) throws org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static String getLastCommitId(org.eclipse.jgit.api.Git git) throws org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.MergeResult mergeBack(org.eclipse.jgit.api.Git git,
String strUserName,
String strPassword,
CommandResult commandResult)
throws IOException,
org.eclipse.jgit.api.errors.GitAPIException
IOExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static GithubSearchResult searchRepo(String strSearch, String strOrganization, String strUserName, String strPassword)
public static String getFileContent(String strFullName, String strPathFile, String strBranch, String strUserName, String strPassword)
public static org.eclipse.jgit.api.Git getGit(String strClonePath)
Copyright © 2019 City of Paris. All rights reserved.