public class GitHelpers extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
gitignore |
static Map<String,org.eclipse.jgit.lib.Repository> |
typeRepo |
static Map<String,String> |
typeToRepo |
| Constructor and Description |
|---|
GitHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static org.eclipse.jgit.revwalk.RevCommit |
commitChanges(org.eclipse.jgit.lib.Repository r,
String commitMessage) |
static org.eclipse.jgit.revwalk.RevCommit |
commitChanges(String type,
String commitMessage) |
static org.eclipse.jgit.revwalk.RevCommit |
commitDelete(String type,
String deletePath,
String commitMessage) |
static void |
createDirIfNotExists(String dir) |
static org.eclipse.jgit.lib.Repository |
ensureGitRepo(String REPOS_BASE_DIR) |
static void |
ensureGitRepo(String type,
String REPOS_BASE_DIR) |
static Set<String> |
getChanges(String type) |
static String |
getGitHeadFileContent(org.eclipse.jgit.lib.Repository repository,
String filepath,
String commitString) |
static String |
getGitHeadFileContent(String repo,
String filepath) |
static String |
getGitHeadFileContent(String repo,
String filepath,
String commit) |
static org.eclipse.jgit.lib.Repository |
getLocalRepo(String type) |
static void |
main(String[] args) |
static String |
pull(String type) |
static org.eclipse.jgit.api.PullResult |
pull(String type,
String REPOS_BASE_DIR) |
static Iterable<org.eclipse.jgit.transport.PushResult> |
push(org.eclipse.jgit.lib.Repository r,
String REMOTE_BASE_URL,
String user,
String pass) |
static Iterable<org.eclipse.jgit.transport.PushResult> |
push(String type,
String REMOTE_BASE_URL,
String user,
String pass,
String REPOS_BASE_DIR) |
static Iterable<org.eclipse.jgit.transport.PushResult> |
push(String type,
String REMOTE_BASE_URL,
org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider prov,
String REPOS_BASE_DIR) |
public static final String gitignore
public static void createDirIfNotExists(String dir)
public static org.eclipse.jgit.lib.Repository ensureGitRepo(String REPOS_BASE_DIR)
public static org.eclipse.jgit.revwalk.RevCommit commitChanges(String type, String commitMessage)
public static org.eclipse.jgit.revwalk.RevCommit commitChanges(org.eclipse.jgit.lib.Repository r,
String commitMessage)
public static org.eclipse.jgit.revwalk.RevCommit commitDelete(String type, String deletePath, String commitMessage)
public static org.eclipse.jgit.lib.Repository getLocalRepo(String type)
public static String getGitHeadFileContent(String repo, String filepath) throws IOException
IOExceptionpublic static String getGitHeadFileContent(String repo, String filepath, String commit) throws IOException
IOExceptionpublic static String getGitHeadFileContent(org.eclipse.jgit.lib.Repository repository, String filepath, String commitString) throws IOException
IOExceptionpublic static org.eclipse.jgit.api.PullResult pull(String type, String REPOS_BASE_DIR) throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.WrongRepositoryStateExceptionorg.eclipse.jgit.api.errors.InvalidConfigurationExceptionorg.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.CanceledExceptionorg.eclipse.jgit.api.errors.RefNotFoundExceptionorg.eclipse.jgit.api.errors.RefNotAdvertisedExceptionorg.eclipse.jgit.api.errors.NoHeadExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionpublic static String pull(String type) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static Iterable<org.eclipse.jgit.transport.PushResult> push(String type, String REMOTE_BASE_URL, org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider prov, String REPOS_BASE_DIR) 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 Iterable<org.eclipse.jgit.transport.PushResult> push(String type, String REMOTE_BASE_URL, String user, String pass, String REPOS_BASE_DIR) 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 Iterable<org.eclipse.jgit.transport.PushResult> push(org.eclipse.jgit.lib.Repository r, String REMOTE_BASE_URL, String user, String pass) 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 void main(String[] args) throws IOException
IOExceptionCopyright © 2020. All rights reserved.