git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* what is the function of .git/branches/?
@ 2017-11-05  9:24 Robert P. J. Day
  2017-11-05  9:38 ` Jeff King
  2017-11-06  1:41 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Robert P. J. Day @ 2017-11-05  9:24 UTC (permalink / raw)
  To: Git Mailing list


  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?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what is the function of .git/branches/?
  2017-11-05  9:24 what is the function of .git/branches/? Robert P. J. Day
@ 2017-11-05  9:38 ` Jeff King
  2017-11-06  1:41 ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff King @ 2017-11-05  9:38 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Git Mailing list

On Sun, Nov 05, 2017 at 11:24:00AM +0200, Robert P. J. Day wrote:

>   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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what is the function of .git/branches/?
  2017-11-05  9:24 what is the function of .git/branches/? Robert P. J. Day
  2017-11-05  9:38 ` Jeff King
@ 2017-11-06  1:41 ` Junio C Hamano
  2017-11-06  5:33   ` Robert P. J. Day
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2017-11-06  1:41 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Git Mailing list

"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?

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).

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what is the function of .git/branches/?
  2017-11-06  1:41 ` Junio C Hamano
@ 2017-11-06  5:33   ` Robert P. J. Day
  0 siblings, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2017-11-06  5:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing list

On Mon, 6 Nov 2017, Junio C Hamano wrote:

> "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?

> 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).

> 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
========================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-06  5:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-05  9:24 what is the function of .git/branches/? Robert P. J. Day
2017-11-05  9:38 ` Jeff King
2017-11-06  1:41 ` Junio C Hamano
2017-11-06  5:33   ` Robert P. J. Day

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).