public class GitUtil extends Object
Constructor and Description |
---|
GitUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkoutPull(String url,
File file,
String branchName,
org.eclipse.jgit.transport.CredentialsProvider credentialsProvider)
拉取对应分支最新代码
|
static List<String> |
getBranchList(String url,
String userName,
String userPwd) |
static String |
getLastCommitMsg(File file,
String branchName)
获取对应分支的最后一次提交记录
|
public static List<String> getBranchList(String url, String userName, String userPwd) throws org.eclipse.jgit.api.errors.GitAPIException, IOException
org.eclipse.jgit.api.errors.GitAPIException
IOException
public static void checkoutPull(String url, File file, String branchName, org.eclipse.jgit.transport.CredentialsProvider credentialsProvider) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
url
- 远程urlfile
- 仓库路径branchName
- 分支名credentialsProvider
- 凭证IOException
- IOorg.eclipse.jgit.api.errors.GitAPIException
- apipublic 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–2019. All rights reserved.