From: Ramana Kumar Date: Thu, 23 Sep 2010 03:46:06 GMT Subject: get-upstream Message-ID: Is there an easy command to get a symbolic reference to the upstream branch of a tracking branch? For example, to get the current branch name I can do this: $ git symbolic-ref HEAD refs/heads/mybranchname Now I can see the upstream name as follows $ git branch -vv branch1 ... mybranchname sha [upstreamname: ahead n] ... branch3 ... My question is is there a way to get upstreamname directly to stdout, similar to the symbolic-ref command? (I don't want to have to type it manually; tab completion helps a little, but looking for more. Plus this would be necessary to avoid scraping in a script.)