Coderwall Tip: .gitignore is not working

Algunas veces quiero ignorar un archivo, lo agrego a .gitignore y el archivo no desaparece de mi lista de cambios. Lo siguiente es un tip que quiero recordar porque siempre termino entrando a StackOverflow para leer la respuesta a esta pregunta.

Even if you haven’t tracked the files so far, git seems to be able to “know” about them even after you add them to .gitignore.

NOTE : First commit your current changes, or you will lose them. Then run the following commands from the top folder of your git repo:

git rm -r --cached .
git add .
git commit -m "fixed untracked files"

Eleazar Resendez

A software engineer — for the last 3 years focused on Laravel framework. Reliable, responsible, serious with a strong entrepreneurial can-Do mentality and the goal of making a huge positive impact on this world.

Read More