Skip to content

Instantly share code, notes, and snippets.

View maya257's full-sized avatar
🏠
Working from home

Maya maya257

🏠
Working from home
View GitHub Profile
@maya257
maya257 / 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