Why does the "git index" have so many names?

Viewed 223

While reading how to use Git, I found a lot of different names for git index.

They were:

  • directory cache
  • current directory cache
  • staging files
  • staging area

How come there are so many options to name exactly one thing?

How I should to name it to not to confuse my future interlocutors whose backgrounds I do not know?

3 Answers

With Git 2.30.1 (Q1 2021), the documentation is now clearer regarding "index" synonyms based on "cache": they are obsolete and purged from said documentation.

See commit b356d23 (08 Jan 2021) by Utku Gultopu (ugultopu).
(Merged by Junio C Hamano -- gitster -- in commit eecc5f0, 15 Jan 2021)

doc: remove "directory cache" from man pages

Signed-off-by: Utku Gultopu

"directory cache" (or "directory cache index", "cache") are obsolete terms which have been superseded by "index".
Keeping them in the documentation may be a source of confusion.
This commit replaces them with the current term, "index", on man pages.

git ls-files now includes in its man page:

This merges the file listing in the index with the actual working directory list, and shows different combinations of the two.

git update-index now includes in its man page:

Modifies the index.
Each file mentioned is updated into the index and any 'unmerged' or 'needs updating' state is cleared.

Related