Skip to main content

Folder Structure

  1. INDEX - Contains the actual repository structure that's currently checked out in the working tree. Any changes done to any files are added to this file using git add command. Also any changes are recognized by comparing hash of the files in this file.

  2. HEAD - Just points to current root commit. This is a local file and never pushed as part of the git push command.

Git Clone Steps
What's a working directory?

Working directory is nothing but the actual folder where the repository has a INDEX file created and has the corresponding repository files created.

What's worktrees?

Worktrees just allows us to create multiple copies of working directory without duplicating the main data from .git folder.

Every worktree, will have it's own INDEX and working directory but the object database pointing to one single .git folder. With the help of this, we just clone the repository once but can work on different worktrees.