What is the Git Working Tree? or working Area

About

The working tree (or working area) is a root directory and all its sub-directories where the work on your files happens (extraction, modification, commit).

Root

The location of the root work tree is:

It's called a tree because the directory is synchronized by git in the git repository as a tree object.

Usage

It's an file system tree (area) where:

  • you can browse and modify your files with your file explorer.
  • you will see all modified file that are not yet committed. Before running the commit command, you must use the add command to add any new or modified files to the index (staging area)

Management

Purge

If you want to your working directory back to the status of upstream (server repo), the following commands can be used (remember everything you've worked on is gone after these):

git reset --hard upstream/master
git clean -fdx





Discover More
Git File Lifecycle
What is the Git File Status?

The status of a file in a working directory is one of: where: State Tracked Description untracked New file unmodified Tracked File is the same as in the last commit modified Tracked File...



Share this page:
Follow us:
Task Runner