Subject: Re: Definition of "the Git repository"

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Fri, 25 Jun 2021 07:56:49 +0200

On Fri, Jun 25 2021, Kevin Buckley wrote:

> Hi there,
>
> raising this on the back of a discussion over at the Software
> Carpentry lesson about Git,
>
>    https://github.com/swcarpentry/git-novice/issues/810
>
> I used the book to justify my claim that it is the .git directory
> that is the repository, but I do have to concede that the way that
> the text in section 2.1 of the book reads, does suggest that one
> can refer to the working directory PLUS the .git directory as a
> "repository" as well as being able to refer to the .git directory
> alone as the "repository".
>
> In the way I think of it
>
> git init
>
> initialises a Git repository, however, the only thing that changes
> as a result is that a .git directory has been created, ergo, the
> .git directory is the repository.
>
> Furthermore, the fact that one can take the .git directory, move it
> to a new directory and start using it there (very much a nice feature)
> also suggests to me that it is the .git directory that is the repository,
> as distict from a working directory, under Git control because of the
> existence of a repository within it.
>
> Interested to hear any thoughts around the semantics here,
> Kevin Buckley

I think the right answer to this is that there is no right answer, if
you read gitglossary(7) you'll find it mostly backs your argument, but
you'll also find mentions in git's own documentation that say things
like "a subdirectory of your repository" when referring to the
repository's working tree.

More importantly it seems like this is documentation for novices, I
think it's generally more important to get important notions like their
historical data being stored in that .git thingy than it is to nail down
every concept involved in that with 100% accuracy.