Skip to main content

Git Untrack previous committed files

·97 words·1 min·
Git
Table of Contents

This article is about git and untrack committed files

Intro
#

This is something that sometimes bugs me, you keep hitting the .gitinore configuration file but still the file you try to ignore always gets referenced on your changes.

If that happens most probably you’ve reference it in the past to be track and you need to remove it, so this are the steps.

Update your .gitignore and untrack the file
#

This example to untrack db.json

  1. Change the entry in .gitignore ex: *.json

  2. Execute the following command to untrack

git update-index --assume-unchanged db.json
  1. Commit the changes