Skip to content

Instantly share code, notes, and snippets.

@mcrd25
mcrd25 / untrackfiles_git.md
Last active November 13, 2023 11:01
How to untrack a file that has already been committed to repo after adding to .gitignore

How to Untrack a File That Has Been Committed

It is IMPORTANT to note that you MUST COMMIT ALL PREVIOUS CHANGES BEFOE CONTINUING

  1. Remove everything from Local Repo git rm -r --cached . or if you are untracking a specific file(s) git rm -r --cached name_of_file

  2. Add back all untracked files