Working Directory
About
In Git, the working directory (also called working tree) is the part of our local Git repository where we see and modify actual files.
Example:
When we run:
Git will:
Download the
.git
directory (where all Git history, configuration, and metadata live),And also extract all files from the latest commit into our current directory.
That visible folder with code files, docs, configs, etc., is our working directory — it's what we edit.
How Is It Different From a Bare Repository?
Type
Contains Git History
Contains Files You Edit (Working Dir)
Typical Use
Regular repo
.git
folder
Working directory (code files)
Development, coding
Bare repository
Git data only
No working directory
Backup, remote host
Bare repo example:
Creates
repo.git/
Inside: only Git history and metadata
No code files — we can't run or edit the project here
Last updated
Was this helpful?