How can I tell which remote "parent" branch my branch is based on?

Andrew Falanga picture Andrew Falanga · Jun 23, 2011 · Viewed 71k times · Source

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:

  • make a branch locally, based off of the desired remote tracking branch
  • make our changes
  • build/test/fix
  • commit
  • push back to the remote server

I've noticed that "git status" doesn't show me what branch my local branch is based on unless something has changed; i.e. uncommitted local changes or a recent fetch puts my local branch behind the times. Is there some way of knowing what branch my local branch is based on without having to change things? Something like, "git status -showparentbranch" or some other command that would show this. Occasionally I run into this need but don't know yet how to satisfy it.

Answer

elrrrrrrr picture elrrrrrrr · Oct 15, 2015

try this:

git log --graph --decorate