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

Re: Definition of "the Git repository"

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 28, 2021, 03:24 UTC
Message-ID
<60d9410bb07a1_aac5d20888@natae.notmuch>
In-Reply-To
<12dd4f05-456f-c763-441e-5bb16634306a@pawsey.org.au>
Kevin Buckley wrote:
Show 6 quoted lines
> Everything within the .git directory "belongs", in my way of thinking,
> to the "repository", that is, the directory that gets created when git
> is (init)ialised.
> 
> For me, the 'objects", the 'ref/heads', the "staging area' and the like,
> also lie within the repository.
Does it?

Suppose you have three directories, each with exactly the same contents in their corresponding .git directory, the only difference is the .git/index file:

 a) No .git/index file at all
 b) The .git/index file doesn't have anything staged
 c) The .git/index file contains some staged changes
Do you really consider them three different repositories?

In my mind the staging area is where you put stuff in preparation for the commit. The commit is part of the repository, the staging area isn't.

-- 
Felipe Contreras
Previous: Kevin BuckleyNext: Kevin Buckley
Message 8 of 15 in “Definition of "the Git repository"”
  1. Kevin BuckleyJun 25, 2021
  2. Ævar Arnfjörð BjarmasonJun 25, 2021
  3. Igor DjordjevicJun 25, 2021
  4. Igor DjordjevicJun 25, 2021
  5. Felipe ContrerasJun 25, 2021
  6. Philip OakleyJun 25, 2021
  7. Kevin BuckleyJun 28, 2021
  8. Felipe ContrerasJun 28, 2021
  9. Kevin BuckleyJun 28, 2021
  10. Felipe ContrerasJun 28, 2021
  11. Kevin BuckleyJun 29, 2021
  12. Felipe ContrerasJun 29, 2021
  13. Philip OakleyJun 28, 2021
  14. Chris TorekJun 28, 2021
  15. Junio C HamanoJun 29, 2021

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.