我想使用 JGit 确定 HEAD 的远程跟踪分支。
在直接 git 中,我可以这样做:
git rev-parse --abbrev-ref --symbolic-full-name @{upstream}
Run Code Online (Sandbox Code Playgroud)
我怎样才能在 JGit 中做到这一点?
new BranchConfig(repo.getConfig(), repo.getBranch()).getTrackingBranch()
Run Code Online (Sandbox Code Playgroud)