How to “cat” a file in JGit?
Unfortunately Thilo’s answer does not work with the latest JGit API. Here is the solution I found: File repoDir = new File(“test-git”); // open the repository Repository repository = new Repository(repoDir); // find the HEAD ObjectId lastCommitId = repository.resolve(Constants.HEAD); // now we have to get the commit RevWalk revWalk = new RevWalk(repository); RevCommit commit = … Read more