Sparse Checkout support [message #1794114] |
Thu, 23 August 2018 16:18  |
Eclipse User |
|
|
|
Hello,
I tried replicating these commands and I am not seeing same results when using git command or JGit API.
git init
git remote add -f origin REMOTE_SERVER
git config core.sparsecheckout true
echo "FOLDER_NAME/*"> .git/info/sparse-checkout // Created file must have ANSI encoding
git pull origin master
Using command line I'm getting only FOLDER_NAME retrieved.
I tried doing same in code and folder not being retrieved.
try (Git git = Git.init().setDirectory(localPath).call()) {
StoredConfig config = git.getRepository().getConfig();
config.setString("remote", "origin", "url", "REMOTE_SERVER");
config.setBoolean("core", null, "sparsecheckout", true);
config.save();
Path file = Paths.get(localPath.getAbsolutePath() + "/.git/info/sparse-checkout");
Files.write(file, Arrays.asList("FOLDER_NAME/*"), Charset.forName("ISO-8859-1"));
PullResult result = git.pull()
.setRemote("origin")
.setRemoteBranchName("master")
.call();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (GitAPIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
|
|
|
|
|
|
|
Re: Sparse Checkout support [message #1858076 is a reply to message #1844902] |
Tue, 14 March 2023 15:47  |
Eclipse User |
|
|
|
We would also very much like to see sparse checkouts supported in JGit!
We are using Oxygen XML Author for technical writing. It provides an integrated Git client that uses JGit internally. Our various Git repos contain between 60k to 100k files, and many JGit operations are painfully slow with the full repository.
|
|
|
Powered by
FUDForum. Page generated in 0.06383 seconds