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

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

From
Jeff King <peff@peff.net>
Date
Nov 5, 2017, 09:38 UTC
Message-ID
<20171105093808.oxxchoh6j4b6yv37@sigill.intra.peff.net>
In-Reply-To
<alpine.LFD.2.21.1711051122160.3602@localhost.localdomain>
On Sun, Nov 05, 2017 at 11:24:00AM +0200, Robert P. J. Day wrote:
Show 5 quoted lines
>   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?

It's a historical way of storing what's now in the "[remote]" section of config files. It's covered briefly in "git help repository-layout" (which is a good starting point for similar questions), and in more detail in the REMOTES section of fetch/pull/push.

-Peff
Previous: Robert P. J. DayNext: Junio C Hamano
Message 2 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.