0

I am build a continuous integration pipeline and I am trying to figure out when people create a pull request, what is the base branch. For example if people create a personal branch X from base branch master and then create a pull request, I would like to know that it was based off of "master". Similarly if someone creates a branch Y from base branch alpha then I want to get that "alpha". Is there any way to do this using git command directly?

Peiti Li
  • 4,634
  • 9
  • 40
  • 57
  • 1
    Usually this is exposed by the CI system itself. If you're building one yourself, generally you query the API for the pull request to find the base branch, or you get the data sent over by a webhook. – bk2204 Aug 18 '20 at 23:14
  • 1
    Git does not store such information. Branches do not have base branches: the closest Git gets to this is either setting the *upstream* of a branch, or using the two-dot `start..end` notation, but when using `start..end` *you* pick the `start` part every time. – torek Aug 19 '20 at 05:15

0 Answers0