Skip to content
BENIBIX Learn

Working Directory

Development🔀 Version ControlGit Basics

Also known as Working Tree, Working Copy

The project files you see and change right now. Git has not saved them yet.

Think of it like

Think of it like your desk. The papers on it are the ones you are working on right now.

Example

Jack edits index.html and saves it. The change is in his working directory, but Git has not recorded it yet.

Why it matters

What is only here is what you could still lose. So check it before you shut down.

Definition

The working directory is the set of files you see and edit in your project folder. It is where you type, save and test your changes. Git compares it with the last commit to see what you have changed. Changes here are not part of the history until you stage and commit them. The git status command shows what is different.

Example code

console
$ git status --short
?? index.html
The ?? means Git sees a new file it is not tracking yet.

Common mistake

Thinking a saved file is safe in Git. Saving in the editor is not a commit.

Key takeaways

  1. 1
    What you edit. The files open in your editor.
  2. 2
    Not yet history. Changes here are not recorded.
  3. 3
    Check with status. git status shows what changed.

Learn it properly