Reputation: 808
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?
Upvotes: 60
Views: 95139
Reputation: 1
git reflog
Try this command and see where your current branch checked out first. For example, you have branches A, B, and C. Your current branch is C and you are unaware of the origin. git reflog
will provide you with a log of the branches moved from one head to another till the recent one. There you will have to find out from which point the branch is checked out or moved first.
e.g, (HEAD -> test/branchC, origin/HEAD, test/branchA) HEAD@{0}: checkout: moving from test/branchA to test/branchC
in this case, branch's origin is test/branchA.
Upvotes: 0
Reputation: 91
What you're looking for is the Graph available on the Repository menu :
See screenshot
Upvotes: 1
Reputation: 1856
For people who just want to see all the remote urls
git remote -v
Upvotes: 19
Reputation: 308
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.
Upvotes: 14
Reputation: 1984
git remote show origin
shows remote and local branches with tracking info.
Upvotes: 55