Say if my project contains two masters (master and master_ios) and I want to see what the origin of a feature branch is (by origin, i mean the branch the feature branch is based off), how would I accomplish this in git?
Asked
Active
Viewed 7.3k times
52
-
4[Find common ancestor of two branches](http://stackoverflow.com/questions/1549146/find-common-ancestor-of-two-branches) solves your task – Alex Dvoretsky Sep 12 '14 at 19:06
-
The question is not asking to find a common ancestor. Is it? – canbax Oct 19 '21 at 14:21
5 Answers
52
git remote show origin
shows remote and local branches with tracking info.

xxxxx
- 1,918
- 2
- 17
- 22
-
46this command only tells me, that my branch is tracked but not its origin. So how is this the answer to the question? – Oct 17 '18 at 20:18
-
This command asks for a password if not authorized. Not suitable if you just want to get the remote URL. – Darrarski Feb 14 '22 at 11:25
-
@user8434768 In local branch section it shows the remote branch of your local branchs. – haj_baba Jun 11 '23 at 08:00
11
Git does not track what branch a commit was created on and does not track where a branch was branched off from. There is no information in git that you can use answer that question.

Lequerica Martin
- 168
- 2
- 9
1