33

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?

samoz
  • 54,375
  • 53
  • 140
  • 191
dlucci
  • 519
  • 2
  • 7
  • 24

3 Answers3

32
git remote show origin

shows remote and local branches with tracking info.

Preethi
  • 1,630
  • 2
  • 15
  • 22
  • 38
    this 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
11

For people who just want to see all the remote urls

git remote -v

Daltron
  • 1,259
  • 1
  • 13
  • 30
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.

source: https://community.atlassian.com/t5/Bitbucket-questions/Knowing-from-which-branch-the-current-branch-was-created-from/qaq-p/570135