public abstract class GitUtil extends Object
| 构造器和说明 |
|---|
GitUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.eclipse.jgit.api.Git |
add(org.eclipse.jgit.api.Git git) |
static org.eclipse.jgit.api.Git |
add(org.eclipse.jgit.api.Git git,
String filePath) |
static org.eclipse.jgit.api.Git |
commit(org.eclipse.jgit.api.Git git,
String message) |
static org.eclipse.jgit.api.Git |
commitNoAdd(org.eclipse.jgit.api.Git git,
String message) |
static String |
getHostUrl(String repos)
由git库地址得到主机地址,出错或者格式不合法返回null
|
static String |
getPwd(String pwd) |
static String |
getUser(String user) |
static org.eclipse.jgit.api.Git |
merge(org.eclipse.jgit.api.Git git,
String branchSrc,
String branchDst,
boolean forceCreateDst) |
static org.eclipse.jgit.api.Git |
merge4Master(org.eclipse.jgit.api.Git git,
String branch) |
static org.eclipse.jgit.api.Git |
newBranch(org.eclipse.jgit.api.Git git,
String branchName) |
static org.eclipse.jgit.api.Git |
newBranch(org.eclipse.jgit.api.Git git,
String branchName,
String user,
String pwd) |
static org.eclipse.jgit.api.Git |
openOrClone(String workDir,
String repo,
String branch) |
static org.eclipse.jgit.api.Git |
openOrClone(String workDir,
String repo,
String branch,
String user,
String pwd)
打开或是克隆一个git库
|
static org.eclipse.jgit.api.PullResult |
pull(org.eclipse.jgit.api.Git git,
String user,
String pwd) |
static org.eclipse.jgit.api.Git |
push(org.eclipse.jgit.api.Git git,
String branch,
String user,
String pwd) |
static org.eclipse.jgit.api.Git |
push2Branch(org.eclipse.jgit.api.Git git,
String branch) |
static org.eclipse.jgit.api.Git |
push2Branch(org.eclipse.jgit.api.Git git,
String branch,
String user,
String pwd) |
static org.eclipse.jgit.api.Git |
push2Master(org.eclipse.jgit.api.Git git,
String branch) |
static org.eclipse.jgit.api.Git |
push2Master(org.eclipse.jgit.api.Git git,
String branch,
String user,
String pwd) |
public static org.eclipse.jgit.api.Git newBranch(org.eclipse.jgit.api.Git git,
String branchName,
String user,
String pwd)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git newBranch(org.eclipse.jgit.api.Git git,
String branchName)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git openOrClone(String workDir, String repo, String branch, String user, String pwd) throws org.eclipse.jgit.api.errors.GitAPIException
workDir - 工作空间repo - gity库地址branch - 分支user - 用户名pwd - 密码org.eclipse.jgit.api.errors.GitAPIException - exceptionpublic static org.eclipse.jgit.api.PullResult pull(org.eclipse.jgit.api.Git git,
String user,
String pwd)
throws Exception
Exceptionpublic static org.eclipse.jgit.api.Git openOrClone(String workDir, String repo, String branch) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static String getHostUrl(String repos)
repos - git库地址public static org.eclipse.jgit.api.Git merge(org.eclipse.jgit.api.Git git,
String branchSrc,
String branchDst,
boolean forceCreateDst)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git merge4Master(org.eclipse.jgit.api.Git git,
String branch)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git push2Branch(org.eclipse.jgit.api.Git git,
String branch,
String user,
String pwd)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git add(org.eclipse.jgit.api.Git git,
String filePath)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git add(org.eclipse.jgit.api.Git git)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git commit(org.eclipse.jgit.api.Git git,
String message)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git commitNoAdd(org.eclipse.jgit.api.Git git,
String message)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git push(org.eclipse.jgit.api.Git git,
String branch,
String user,
String pwd)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git push2Branch(org.eclipse.jgit.api.Git git,
String branch)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git push2Master(org.eclipse.jgit.api.Git git,
String branch,
String user,
String pwd)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionpublic static org.eclipse.jgit.api.Git push2Master(org.eclipse.jgit.api.Git git,
String branch)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionCopyright © 2018. All rights reserved.