{"thread":{"id":"47121","subject":"what is the function of .git/branches/?","startedAt":"2017-11-05T09:24:19Z","lastAt":"2017-11-06T05:33:36Z","messageCount":4,"participants":["Robert P. J. Day","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"331857","messageId":"alpine.LFD.2.21.1711051122160.3602@localhost.localdomain","threadId":"47121","inReplyTo":null,"subject":"what is the function of .git/branches/?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2017-11-05T09:24:00Z","receivedAt":"2017-11-05T09:24:19Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n  currently proofing \"pro git\" book, and an example of a new repo\ndoesn't show a .git/branches/ directory, but initializing a new repo\nwith current version of 2.13.6 *does* show an initially empty\ndirectory by that name. however, AFAICT, branches are still tracked\nunder .git/refs/heads/, so what's with that branches/ directory?\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                        http://crashcourse.ca\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"331858","messageId":"20171105093808.oxxchoh6j4b6yv37@sigill.intra.peff.net","threadId":"47121","inReplyTo":"alpine.LFD.2.21.1711051122160.3602@localhost.localdomain","subject":"Re: what is the function of .git/branches/?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-11-05T09:38:08Z","receivedAt":"2017-11-05T09:38:15Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Nov 05, 2017 at 11:24:00AM +0200, Robert P. J. Day wrote:\n\n>   currently proofing \"pro git\" book, and an example of a new repo\n> doesn't show a .git/branches/ directory, but initializing a new repo\n> with current version of 2.13.6 *does* show an initially empty\n> directory by that name. however, AFAICT, branches are still tracked\n> under .git/refs/heads/, so what's with that branches/ directory?\n\nIt's a historical way of storing what's now in the \"[remote]\" section of\nconfig files. It's covered briefly in \"git help repository-layout\"\n(which is a good starting point for similar questions), and in more\ndetail in the REMOTES section of fetch/pull/push.\n\n-Peff\n"},{"id":"331897","messageId":"xmqqo9ogji9z.fsf@gitster.mtv.corp.google.com","threadId":"47121","inReplyTo":"alpine.LFD.2.21.1711051122160.3602@localhost.localdomain","subject":"Re: what is the function of .git/branches/?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-06T01:41:12Z","receivedAt":"2017-11-06T01:41:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Robert P. J. Day\" <rpjday@crashcourse.ca> writes:\n\n>   currently proofing \"pro git\" book, and an example of a new repo\n> doesn't show a .git/branches/ directory, but initializing a new repo\n> with current version of 2.13.6 *does* show an initially empty\n> directory by that name. however, AFAICT, branches are still tracked\n> under .git/refs/heads/, so what's with that branches/ directory?\n\nThere are three ways to specify what branches of which remote\nrepository your fetch and/or push interacts with, and having\n.git/branches/foo file is one of these three ways (the other two are\nto have .git/remotes/foo file, and to have [remote \"foo\"] section in\nthe .git/config).\n\nIf your workflow involves having to interact with tons of remotes\n(imagine being a maintainer who regularly pulls from dozens of\nsub-maintainer's repositories, each of which places the material to\nbe upstreamed on a single branch) and that set changes from time to\ntime, using .git/branches/* is a lot more efficient than having to\nkeep track of the same information in other two formats, so even\nthough it was the invented the earliest and is the least flexible\nformat among the three, it still has its uses.\n"},{"id":"331907","messageId":"alpine.LFD.2.21.1711060731070.13351@localhost.localdomain","threadId":"47121","inReplyTo":"xmqqo9ogji9z.fsf@gitster.mtv.corp.google.com","subject":"Re: what is the function of .git/branches/?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2017-11-06T05:33:17Z","receivedAt":"2017-11-06T05:33:36Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Mon, 6 Nov 2017, Junio C Hamano wrote:\n\n> \"Robert P. J. Day\" <rpjday@crashcourse.ca> writes:\n>\n> >   currently proofing \"pro git\" book, and an example of a new repo\n> > doesn't show a .git/branches/ directory, but initializing a new\n> > repo with current version of 2.13.6 *does* show an initially empty\n> > directory by that name. however, AFAICT, branches are still\n> > tracked under .git/refs/heads/, so what's with that branches/\n> > directory?\n\n> There are three ways to specify what branches of which remote\n> repository your fetch and/or push interacts with, and having\n> .git/branches/foo file is one of these three ways (the other two are\n> to have .git/remotes/foo file, and to have [remote \"foo\"] section in\n> the .git/config).\n\n> If your workflow involves having to interact with tons of remotes\n> (imagine being a maintainer who regularly pulls from dozens of\n> sub-maintainer's repositories, each of which places the material to\n> be upstreamed on a single branch) and that set changes from time to\n> time, using .git/branches/* is a lot more efficient than having to\n> keep track of the same information in other two formats, so even\n> though it was the invented the earliest and is the least flexible\n> format among the three, it still has its uses.\n\n  ah, useful to know, thanks. as i mentioned, i'm clawing my way\nthrough the current version of the \"pro git\" book and submitting all\nsorts of updates, and this is the sort of thing i'm keeping track of\nto see if i can sneak it in somewhere.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                        http://crashcourse.ca\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"}]}