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 4.6k times
33
-
3[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
3 Answers
32
git remote show origin
shows remote and local branches with tracking info.
Preethi
- 1,630
- 2
- 15
- 22
-
38this 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
7
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
- 101
- 1
- 6