Skip to main content

Folder Structure

  1. INDEX - Holds the repository structure currently checked out in the working tree. The git add command adds your file changes to it. Git also spots changes by comparing the file hashes in it.

  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?

The working directory is just the folder where the repository has its INDEX file and its files.

What's worktrees?

Worktrees let you make many copies of the working directory without duplicating the main data in the .git folder.

Each worktree has its own INDEX and working directory. Still, the object database points to one .git folder. You clone the repository once and work on many worktrees.