Getting commits above HEAD

It might be some kind of repetitive question, but I can't seem to find a proper solution. I'm getting a list of commits using GitHistoryUtils.history(). In case one of the lower revisions (in a commit tree) is checked out, this commit becomes first in a resulting list and all of the above get ignored.

Is there a way to grab a full list of commits just like the IDEA itself does it when HEAD is lower on the list, but Vcs Log window shows all the commits from previously checked out branch (in my case 'master')? 

For example, having 20 commits and checking out a commit right in the middle of the list makes GitHistoryUtils.history() return 10 commits instead of all 20. Please let me know if there's a way to retrieve everything.

Thank you!


Hi, "history" method works by running a git log command. So without parameters it would return commits from HEAD. In order to get commit from a specific branch, you could add the branch to parameters list, or you could use parameters such as "--branches" or "--remotes" to get commits from all local or remote branches.


Thanks, Julia! That's a step forward! One more question, could we group the resulting commits by branches somehow?


Please sign in to leave a comment.