Skip to main content
Tips

How to apply a .gitignore file on an existing repository

By November 20, 2013November 20th, 2023No Comments

First of all, and as a safety recommendation you should commit all pending changes and move to another branch.

Then run this command:

git rm -r --cached .

This removes everything from the index, then just run:

git add .

Commit it:

git commit -m ".gitignore is applied"

Warning: when you push this to a repository and pull from somewhere else into a state where those files are still tracked, the files will be DELETED

Sebastián Becerra

Trabajo con tecnologías web en arquitecturas Cloud. Me gusta descubrir y aprender nuevas tecnologías en Layouts (CSS, Sass, Less), Frameworks de Desarrollo (JQuery, AngularJS, Ionic) y plataformas Web (Wordpress, Joomla, Prestashop). He colaborado con diferentes proyectos de software libre y código abierto con fines sociales. Además participé en distintos eventos TI exponiendo sobre comunidades y educando sobre tecnologías Web.

Leave a Reply