5

I would like to determine the remote tracking branch of HEAD using JGit.

In straight git, I can do:

git rev-parse --abbrev-ref --symbolic-full-name @{upstream}

How can I do this in JGit?

Christian Goetze
  • 2,104
  • 3
  • 31
  • 48

1 Answers1

8
new BranchConfig(repo.getConfig(), repo.getBranch()).getTrackingBranch()
Christian Goetze
  • 2,104
  • 3
  • 31
  • 48