git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: get-upstream

From
Jeff King <peff@peff.net>
Date
Sep 23, 2010, 05:36 UTC
Message-ID
<20100923053600.GA27540@sigill.intra.peff.net>
In-Reply-To
<AANLkTikYnj_00Pdsm+QM1=kvqMpeKDCeOOqOS0XEwMXg@mail.gmail.com>
On Wed, Sep 22, 2010 at 10:15:00PM -0600, Pat Notz wrote:
> On Wed, Sep 22, 2010 at 10:05 PM, Pat Notz <patnotz@gmail.com> wrote:
> > $ git rev-parse --symbolic-full-name @{upstream}
> 
> In all fairness, the @{upstream} syntax requires git >= 1.7.0
You can also use:
  git for-each-ref --format='%(upstream)' `git symbolic-ref HEAD`

which has worked since v1.6.3. It also has the advantage that you can ask for the upstream of something besides the HEAD.

-Peff
Previous: Pat Notz
Message 7 of 7 in “get-upstream”
  1. Ramana KumarSep 23, 2010
  2. Pat NotzSep 23, 2010
  3. Pat NotzSep 23, 2010
  4. Ramana KumarSep 23, 2010
  5. Jeff KingSep 23, 2010
  6. Pat NotzSep 23, 2010
  7. Jeff KingSep 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.