From: Ramana Kumar <ramana.kumar@gmail.com>
To: git@vger.kernel.org
Subject: get-upstream
Date: Thu, 23 Sep 2010 13:46:06 +1000 [thread overview]
Message-ID: <AANLkTikqJmsUo53dRngXcWsoEfcFzLQ-J1V5oZOGUL03@mail.gmail.com> (raw)
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.)
next reply other threads:[~2010-09-23 3:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 3:46 Ramana Kumar [this message]
2010-09-23 4:05 ` get-upstream Pat Notz
2010-09-23 4:15 ` get-upstream Pat Notz
2010-09-23 4:16 ` get-upstream Ramana Kumar
2010-09-23 5:37 ` get-upstream Jeff King
2010-09-23 14:28 ` get-upstream Pat Notz
2010-09-23 5:36 ` get-upstream Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTikqJmsUo53dRngXcWsoEfcFzLQ-J1V5oZOGUL03@mail.gmail.com \
--to=ramana.kumar@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).