git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Git Mailing list <git@vger.kernel.org>
Subject: Re: what is the function of .git/branches/?
Date: Mon, 06 Nov 2017 10:41:12 +0900	[thread overview]
Message-ID: <xmqqo9ogji9z.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <alpine.LFD.2.21.1711051122160.3602@localhost.localdomain> (Robert P. J. Day's message of "Sun, 5 Nov 2017 11:24:00 +0200 (EET)")

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

  parent reply	other threads:[~2017-11-06  1:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-11-06  5:33   ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo9ogji9z.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).