2
我想在GIT中執行稀疏結帳,即從存儲庫檢出一部分工作副本。如何通過Java代碼執行此操作。請參閱建議。如何使用Java在git中執行稀疏結帳
我想在GIT中執行稀疏結帳,即從存儲庫檢出一部分工作副本。如何通過Java代碼執行此操作。請參閱建議。如何使用Java在git中執行稀疏結帳
目前JGit庫(從3.0.0開始)不支持稀疏檢出。
String url = "https://github.com/renaud/solr_noLenghNormSimilarity";
String hash = "802558f58add3a1f5b33f04254194bd7cd59b27f";
String subPath = "src/org";
String dest = "myclone";
File localPath = new File(dest);
Git gitRepo = Git.cloneRepository().setURI(url).setDirectory(localPath).setNoCheckout(true).call();
gitRepo.checkout().setStartPoint(hash).addPath(subPath).call();
gitRepo.getRepository().close();
看到http://stackoverflow.com/questions/14407461/how-do-i-implement-sparse-checkout-in-jgit – centic