How to "cat" a file in JGit?

Viewed 14931

A while back I was looking for an embeddable distributed version control system in Java, and I think I have found it in JGit, which is a pure Java implementation of git. However, there is not much in the way of sample code or tutorials.

How can I use JGit to retrieve the HEAD version of a certain file (just like svn cat or hg cat whould do)?

I suppose this involves some rev-tree-walking and am looking for a code sample.

7 Answers
Related