Git & GitHub
/Intermediate
Working Directory
Definition
A single checkout of one version of the project. These files are pulled out of the compressed database in the `.git` directory and placed on disk for you to use or modify.
Explain Like I'm New
The files you actually see and edit in VS Code. It's the physical folder on your computer. If you delete a line of code and hit Save, you have modified the Working Directory, but Git hasn't saved that change to its history yet.
Real World Example
Your messy desk. It's where you actively chop up paper and glue things together before taking a final photograph of the finished craft.
Common Use Cases
- •Active development
Terminal Output
bash / terminal
# You open 'index.html' and type some code.
# At this point, the changes ONLY exist in the Working Directory.
# To see what is currently modified in your Working Directory:
$ git status
# Output: Changes not staged for commit:
# modified: index.html
Interview Questions
basic
- If you make a typo in the Working Directory, is it permanently saved in Git?
intermediate
- What happens to the Working Directory when you switch branches?