Episode 6 of 14

Deleting & Untracking Files

Learn about Deleting & Untracking Files

Remove a file completely: If you delete a tracked file from your directory, Git will notice the deletion. Stage the deletion: You must run git add . or git add followed by the deleted filename to stage the removal. Untrack a file without deleting: If you want to keep the file on your hard drive but remove it from Git's tracking, use a specific remove command. Execute untrack command: Run git rm --cached followed by the filename to stop tracking it while preserving the local file. Check status after untracking: Run git status to confirm the file is now listed as untracked. Commit the removal: Make sure to commit the change to effectively remove the file from the project's tracked history.