8
我想使用jGit克隆存儲庫並簽出一個特定的提交。查看從Git倉庫與JGit的具體修訂
假設提交散列是:1e9ae842ca94f326215358917c620ac407323c81。
我的第一個步驟是:
// Cloning the repository
Git.cloneRepository()
.setURI(remotePath)
.setDirectory(localPath)
.call();
我隨後發現這表明這種方法的另一個問題:
git.checkout().
setCreateBranch(true).
setName("branchName").
setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK).
setStartPoint("origin/" + branchName).
call();
但我不能確定如何將兩個連接在一起?
有什麼想法?
謝謝,這正是我所需要的! – MrD