Ever sent unfinished work because you didn't know what files were changed?
Clean vs dirty working directory in Git - When to Use Which
Imagine you are working on a group project and you have many files open and changed on your computer. You want to share your work, but you are not sure which files you have changed and which are still the original ones.
Manually checking each file to see if it has changed is slow and confusing. You might forget to save some changes or accidentally share unfinished work. This can cause mistakes and waste time fixing problems later.
Git shows you if your working directory is clean or dirty. A clean directory means all changes are saved and ready. A dirty directory means you have unsaved or untracked changes. This helps you know exactly what needs attention before sharing.
open each file and check for changes
git status
This lets you confidently manage your work and avoid errors by knowing the exact state of your files at any time.
Before sending your project to a teammate, you run git status to see if you forgot to save or add any files. This prevents sending incomplete or broken work.
Manual file checks are slow and error-prone.
Git tells you if your working directory is clean or dirty.
This helps you manage changes safely and efficiently.