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

Re: [question] how can i verify whether a local branch is tracking a remote branch?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 6, 2009, 05:28 UTC
Message-ID
<7vy6uecpwd.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090406043426.GC12341@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I don't think it would be unreasonable to expose this functionality via
> "for-each-ref". Something like this (which would need cleanup,
> documentation, and perhaps a :short variant):

I think that is a sane approach, but isn't "tracking" a misnomer? I think what you are describing is what is called "the upstream branch" by the description of Documentation/config.txt::branch.<name>.merge, and not what people call "tracking branch" (see Documentation/glossary-content.txt).

In a repository with a handcrafted fetch refspec, being able to show "tracking" information would also be interesting (e.g. a clone of git.git made with pre-1.5.0 git would say "origin's master" for refs/heads/origin and "origin's next" for refs/heads/next), but the separate-remote layout is the default these days, so it wouldn't be so interesting anymore. In other words, I am not suggesting you to add "tracking" information.

I also wonder if you want to say "this remote" and "that branch" separately. As far as I can tell you are not giving the former but only the latter information?

Previous: Jeff KingNext: Jeff King
Message 5 of 13 in “[question] how can i verify whether a local branch is tracking a remote branch?”
  1. Paolo CiarrocchiApr 5, 2009
  2. Jeff KingApr 5, 2009
  3. Paolo CiarrocchiApr 5, 2009
  4. Jeff KingApr 6, 2009
  5. Junio C HamanoApr 6, 2009
  6. Jeff KingApr 6, 2009
  7. Paolo CiarrocchiApr 6, 2009
  8. Jeff KingApr 6, 2009
  9. Paolo CiarrocchiApr 6, 2009
  10. Jeff KingApr 7, 2009
  11. Michael J GruberApr 6, 2009
  12. Jeff KingApr 6, 2009
  13. Michael J GruberApr 7, 2009

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.