I have a scenario in which there a several remote tracking branches within my local repository that I must sync up to. Our workflow model is:
Git does not track what branches a commit was put through. There is no way to tell. If the commits happened on your repo, then you can inspect the reflog, but that's about it. Take a look at the explanation of the DAG in the Pro Git book - also read up on reflog in there.
You can also visualize history better with gitk --all
or git log --graph --decorate
Hope this helps.
git branch -vv
will:
...from this you will be able to determine the remote branch of the current active branch, and more besides.
If you have a lot of local branches, the list may be very long. Use git branch -vv | grep SOMEWORD
to limit the output to only branches containing SOMEWORD. If you can think of a word unique to your branch you'll get the best filter (one result only).
You will also get some additional data in the output, namely the number (SHA1) and message of the last commit. The grep filter will apply to these to. I couldn't find a way to exclude it.
From the Git branch documentation:
-v
-vv
--verbose
When in list mode, show sha1 and commit subject line for each head, along with relationship to upstream branch (if any). If given twice, print the name of the upstream branch, as well (see also git remote show ).
(Based on your comment, yes, it seems that the 'correct' question would ask about the "remote" branch rather than the "parent" branch. But that's what I searched for too! :) )
try this:
git log --graph --decorate
there are multiple ways to check that. i have endup with Free way to get this result.
use gitkraken(paid for private repository!), it provide you wonderfull way to see Tree of your branchs and commits. by scolling down you will reach root of your parent branch.
if you use bitbucket, then they provide view in web to see all your commits for all branchs(By selecting all branch from dropdown).
Free way, via git commnad.
git log --graph --decorate --oneline --all
Commnad Expaination
git log view log.
--graph view log as graph.
--decorate view log in colorfull mode.
--oneline view log, row only one line not full detail in commits.
--all view log, all branchs. (important to solve this thread)