Ever lost track of which files you changed or added? Git's tracked vs untracked files solve that headache!
Untracked vs tracked files in Git - When to Use Which
Imagine you are working on a project and you keep adding new files or changing existing ones. Without a system to keep track, you might forget which files are new, which ones you changed, or which ones you want to save permanently.
Manually remembering or listing all new and changed files is slow and confusing. You might accidentally lose important changes or include files you didn't want to share. This leads to mistakes and wasted time.
Git automatically separates files into tracked and untracked. Tracked files are those Git knows about and monitors for changes. Untracked files are new files Git hasn't seen yet. This clear separation helps you manage your work easily and safely.
ls -l
# Then try to remember which files are new or changedgit status
# Shows tracked files with changes and untracked new files clearlyThis concept lets you confidently manage your project files, knowing exactly what is saved and what is new, avoiding mistakes and saving time.
When you add a new image or script to your project folder, Git shows it as untracked. You decide when to add it to tracking, so you don't accidentally share unfinished or unwanted files.
Tracked files are those Git monitors for changes.
Untracked files are new files Git hasn't started tracking yet.
Knowing this helps you manage your project safely and efficiently.