【发布时间】:2014-09-13 14:10:23
【问题描述】:
我正在尝试使用 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();
但我不确定如何将两者联系在一起?
有什么想法吗?
【问题讨论】: