.gitignore Explained | Ignore Files in Git | Tracked vs Untracked vs Ignored Files

Published: 13 April 2026
on channel: Sachin Walia
41
5

In this video, you’ll learn what .gitignore is and how it works in Git, using a simple hands-on lab designed for beginners. This Git tutorial explains the difference between tracked, untracked, and ignored files, why Git ignores certain files, and how .gitignore prevents files from being staged accidentally.

I walk through step-by-step examples to show how Git behaves before and after creating a .gitignore file, how ignored files become invisible in git status, and why .gitignore cannot hide files that are already staged or tracked. You’ll also learn when and why git rm --cached is required.

This lesson is perfect for Git beginners, computer science students, DevOps learners, and interview preparation.

🎯 What You Will Learn

What .gitignore is and why it is used
Difference between tracked, untracked, and ignored files
How to create and use a basic .gitignore file
Why ignored files do not appear in git status
Why .gitignore does NOT untrack files
How to stop tracking a file using git rm --cached
How Git decides what gets staged when you run git add .

🧠 Key Concepts Covered

Git tracks files, not folders
Empty directories are invisible to Git
Ignored files stay hidden and cannot be staged accidentally
.gitignore only affects untracked files

🧑‍🎓 Who This Video Is For

Git & GitHub beginners
Engineering and computer science students
DevOps and software development learners
Anyone preparing for Git interview questions

🔔 Subscribe for More

Git & GitHub • Linux • Networking • Python • DevOps • Automation • Career Guidance


On this page of the site you can watch the video online .gitignore Explained | Ignore Files in Git | Tracked vs Untracked vs Ignored Files with a duration of hours minute second in good quality, which was uploaded by the user Sachin Walia 13 April 2026, share the link with friends and acquaintances, this video has already been watched 41 times on youtube and it was liked by 5 viewers. Enjoy your viewing!