0

For a given Pull Request , i need to find out Merge Target of this PR , whether this PR will merge one branch to another branch or one branch to main master branch. is there any git command to do the same? BitBucket API via python/curl are not preferred option.

system is git v1.18 on Centos , repo is private BitBucket .

git show-refs , git log did not not help.

Rajesh
  • 1
  • 1
  • 1
    While i haven't used BitBucket, pull requests are not part of `git` itself, so I don't think there's a way to access information about pull requests without using external APIs. – kotatsuyaki Dec 06 '22 at 07:51
  • 1
    Not with git. PRs are not a git concept. – eftshift0 Dec 06 '22 at 07:51
  • 2
    @rajesh this has nothing to do with c , Linux or c++ please don’t spam tags – user438383 Dec 06 '22 at 07:51
  • 2
    ... or linux, for that matter... or _git_ if it's about PRs :-D – eftshift0 Dec 06 '22 at 07:52
  • removing git was a joke. Just in case, 1.18 is _very_ old git. – eftshift0 Dec 06 '22 at 07:53
  • In git, at least, you could get the upstream branch for a given branch.... it's not like a bullet-proof approach, but at least it is _something_. `git rev-parse --abbrev-ref some-branch@{u}`... and it _might_ be the answer, depending on your workflow. – eftshift0 Dec 06 '22 at 08:06
  • 2
    Git does not know the target merge branch of a PR, unless BitBucket stores that info in a git object. BitBucket API is the right tool to do the job. – ElpieKay Dec 06 '22 at 08:15
  • understood. will go with Rest API way. thanks all. – Rajesh Dec 07 '22 at 05:58

1 Answers1

0

No, there is no such GIT command, as others mentioned, Pull Requests are not part of GIT itself.

You need to go via the Bitbucket API :(

Gec
  • 428
  • 2
  • 10