In git how to find the name of the branch from which my actual branch created? Example: I created my development branch(dev-feature) from integration branch(dev-int). How to trace the integration from feature branch?
Asked
Active
Viewed 86 times
1 Answers
1
You can't.
You branch off from a commit, not from a branch. Branch is just a temporary tag that moves with commits while active.
Say there's a commit 0123456 where you have branch A and B. You make branch C. Which branch did you branch off of? The real answer is "neither" - you branched off from 0123456.
Also, branches don't remember where they started; the only thing you can do is trace the history back, and find where that history attached to the history of another branch. For example, to see where exactly def-feature
history meets dev-int
history,
git merge-base def-feature dev-int

Amadan
- 191,408
- 23
- 240
- 301