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

Re: what is the function of .git/branches/?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Nov 6, 2017, 05:33 UTC
Message-ID
<alpine.LFD.2.21.1711060731070.13351@localhost.localdomain>
In-Reply-To
<xmqqo9ogji9z.fsf@gitster.mtv.corp.google.com>
On Mon, 6 Nov 2017, Junio C Hamano wrote:
Show 8 quoted lines
> "Robert P. J. Day" <rpjday@crashcourse.ca> writes:
>
> >   currently proofing "pro git" book, and an example of a new repo
> > doesn't show a .git/branches/ directory, but initializing a new
> > repo with current version of 2.13.6 *does* show an initially empty
> > directory by that name. however, AFAICT, branches are still
> > tracked under .git/refs/heads/, so what's with that branches/
> > directory?
Show 5 quoted lines
> There are three ways to specify what branches of which remote
> repository your fetch and/or push interacts with, and having
> .git/branches/foo file is one of these three ways (the other two are
> to have .git/remotes/foo file, and to have [remote "foo"] section in
> the .git/config).
Show 8 quoted lines
> If your workflow involves having to interact with tons of remotes
> (imagine being a maintainer who regularly pulls from dozens of
> sub-maintainer's repositories, each of which places the material to
> be upstreamed on a single branch) and that set changes from time to
> time, using .git/branches/* is a lot more efficient than having to
> keep track of the same information in other two formats, so even
> though it was the invented the earliest and is the least flexible
> format among the three, it still has its uses.
  ah, useful to know, thanks. as i mentioned, i'm clawing my way
through the current version of the "pro git" book and submitting all
sorts of updates, and this is the sort of thing i'm keeping track of
to see if i can sneak it in somewhere.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Junio C Hamano
Message 4 of 4 in “what is the function of .git/branches/?”
  1. Robert P. J. DayNov 5, 2017
  2. Jeff KingNov 5, 2017
  3. Junio C HamanoNov 6, 2017
  4. Robert P. J. DayNov 6, 2017

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.