[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jgit-dev] using the JGit library to get a list of all the files from a remote repository
|
You are correct that the Git protocol does not do this.
However you could clone with a depth of 1 which would allow you to iterate through the tree and save downloading the history.
git clone --depth 1 url
I don't think that the JGit API supports a depth restriction.
You could speed it up a little by not doing a checkout afterwards, but that's about it for speeding it up.
A better question might be "why are you trying to get a list of files" ...
Alex
Sent from my iPhone 5
On 27 May 2013, at 13:39, David Portabella <david.portabella@xxxxxxxxx> wrote:
> with svn we can get a list of all the files in a remote repository without checking out the contents locally, with svn list <url>.
>
> if i understood it correctly, the git client/protocol does not allow this possibility.
> so, i would need to do as follows:
> git clone <url>
> git ls-tree -r --name-only remotes/origin/master
>
> however, this means that I need to download all the files locally.
>
> is it possible create a program that lists all the files, without downloading all the files?
> or according to the git procotol, it is impossible to get such a list without downloading the content of all the files?
> if it is possible, can this be done with the JGit library?
> any help in this direction?
>
>
> Regards,
> David
>
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jgit-dev