Git vs Working Directory — what exactly is the difference?
By the end of this article, you will understand the main difference between the two most popularly used coding directories.
Without any further ado, let’s dive straight in.
Creator of a Git vs Working Directory
A working directory is a folder you create to store all your project’s files.
In contrast, a Git directory is a folder Git creates in the working directory you instructed it to monitor.
A Git directory is a hidden file, whereas, a working directory is not.
Usage of a Git vs Working Directory
Git directory serves to record the file versions you authorized Git to track.
However, you create a working repository to store any file.
In other words, you can use a working directory to store files (or folders) that are under version control and those that are not.
Git creates the Git directory inside a working repository. As such, a Git directory lives inside a working repository.
However, a working directory can live anywhere in a system.
Content of a Git vs Working Directory
A working directory contains both Tracked and Untracked files.
In contrast, the Git directory contains only Tracked files.
This Git vs Working directory post highlighted the key differences between the two most popular coding folders.
Note that a working directory can function without a Git directory. However, Git directories need working directories. In other words, a Git directory lives and works inside a working repository.
Featured Image: Waterfall umbrella nature by Michael Luenen
Get Helpful Resources in Your Inbox
A CodeSweetly Digest