public class GitUtil extends Object
https://developer.aliyun.com/ask/275691
https://github.com/centic9/jgit-cookbook
| Constructor and Description |
|---|
GitUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String[] |
checkoutPull(Map<String,Object> parameter,
File file,
String branchName,
PrintWriter printWriter)
拉取对应分支最新代码
|
static String |
checkoutPullTag(Map<String,Object> parameter,
File file,
String branchName,
String tagName,
PrintWriter printWriter)
拉取对应分支最新代码
|
static cn.hutool.core.lang.Tuple |
getBranchAndTagList(Map<String,Object> parameter)
获取仓库远程的所有分支
|
static String[] |
getLastCommitMsg(File file,
String branchName)
获取对应分支的最后一次提交记录
|
public static cn.hutool.core.lang.Tuple getBranchAndTagList(Map<String,Object> parameter) throws Exception
parameter - 参数org.eclipse.jgit.api.errors.GitAPIException - apiExceptionpublic static String[] checkoutPull(Map<String,Object> parameter, File file, String branchName, PrintWriter printWriter) throws Exception
parameter - 参数file - 仓库路径branchName - 分支名IOException - IOorg.eclipse.jgit.api.errors.GitAPIException - apiExceptionpublic static String checkoutPullTag(Map<String,Object> parameter, File file, String branchName, String tagName, PrintWriter printWriter) throws Exception
branchName - 分支名printWriter - 日志输出留parameter - 参数file - 仓库路径tagName - 标签名IOException - IOorg.eclipse.jgit.api.errors.GitAPIException - apiExceptionpublic static String[] getLastCommitMsg(File file, String branchName) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
file - 仓库文件夹branchName - 分支IOException - IOorg.eclipse.jgit.api.errors.GitAPIException - apiCopyright © 2017–2022. All rights reserved.