JGit: How to get all commits of a branch? (Without changes to the working directory …)

前端 未结 6 1867
春和景丽
春和景丽 2020-12-15 23:43

how do I get all commits of a branch with JGit, without changing the working directory?

Unfortunately the JGit docs are not very good ...

In ruby with grit i

6条回答
  •  旧时难觅i
    2020-12-16 00:21

    You are right, the docs should really be better.

    You could use the JGit Log command or use a library like gitective which makes iterating over commits easy. You can look at the source to learn more about JGit.

    Other (more complicated) ways are described in this SO-question.

提交回复
热议问题