问题
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?
回答1:
new BranchConfig(repo.getConfig(), repo.getBranch()).getTrackingBranch()
来源:https://stackoverflow.com/questions/29044207/determine-tracking-branch-in-jgit