From: Pat Notz <patnotz@gmail.com>
To: Ramana Kumar <ramana.kumar@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: get-upstream
Date: Wed, 22 Sep 2010 22:05:42 -0600 [thread overview]
Message-ID: <AANLkTikQ8sHrp+sSZ8e8u7L+6=NHVY3cD9DwChAzLEk0@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikqJmsUo53dRngXcWsoEfcFzLQ-J1V5oZOGUL03@mail.gmail.com>
$ git rev-parse --symbolic-full-name @{upstream}
On Wed, Sep 22, 2010 at 9:46 PM, Ramana Kumar <ramana.kumar@gmail.com> wrote:
> 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.)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2010-09-23 4:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 3:46 get-upstream Ramana Kumar
2010-09-23 4:05 ` Pat Notz [this message]
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='AANLkTikQ8sHrp+sSZ8e8u7L+6=NHVY3cD9DwChAzLEk0@mail.gmail.com' \
--to=patnotz@gmail.com \
--cc=git@vger.kernel.org \
--cc=ramana.kumar@gmail.com \
/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).