Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] How to fetch a specific commit with JGit

I already asked this question on StackOverflow, but I need to confirm if there's a way to do that. In Git, it's possible to fetch specific commit (along with its ancestors of course) using the commit's SHA, so calling git fetch origin 57eab609d9efda3b8ee370582c3762c0e721033d:HEAD is perfectly normal. However, trying to do so with JGit fails, since FetchProcess tries to match the source of the passed RefSpec with the advertisedRefs, which are only the branches and tags.

Is there any way I can fetch a specific commit from a remote repository?

Back to the top