in Git by

What is the difference between ‘HEAD’, ‘working tree’ and ‘index’?

1 Answer

0 votes

The working tree or workspace is the directory containing the source files that you are currently working on.

The index is the staging area in Git where the commits are prepared. It lies between the commit and your working tree. Git index is one large binary file that enlists all files in the current branch, their names, sha1 checksums, and timestamps.

This file is present at <baseOfRepo>/.git/index. HEAD is the reference or pointer to the latest commit in the current checkout branch.

Related questions

0 votes
asked Sep 5, 2020 in Git by SakshiSharma
+2 votes
asked May 13, 2021 in JAVA by rajeshsharma
0 votes
asked Mar 23, 2020 in SAP by AdilsonLima