Git How to Remove Tracked Files From Repository

January 27, 2012 | By Regaz.

The Article shows you How to Remove One or More Tracked files from your git Repository by Resetting the Cached Index.


You can remove a single file with the Command:

git update-index --assume-unchanged 

But if you need to Un-track Multiples Files it’s best the Remove the Entire Index with:

git rm -r --cached .

After you can Insert the files you don’t want git follow to Track inside the .gitignore file.
Next you need to Rebuild your git Index by the Usual git Command:

git add .

You Reset your Head with:

git reset HEAD

Latest you have to Commit your new Repo Version:

git commit -m "Removed files in .gitignore from the Index"

Now your Repository do Not will Track those files again…)

Git How to Unstage Already Staged Changes.

Git Unstage Changes

Git How to Push To Remote Repository.

Git Quick Start