Skip to content

Instantly share code, notes, and snippets.

@VictorVelarde
Last active July 9, 2019 09:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VictorVelarde/95edcac9de9fdb17550123c803639087 to your computer and use it in GitHub Desktop.
Save VictorVelarde/95edcac9de9fdb17550123c803639087 to your computer and use it in GitHub Desktop.
Eliminar definitivamente fichero/s de repo GIT
-- Cuando se cuela en GIT un fichero no deseado, ocupando espacio o dando información inadecuada:
git filter-branch --index-filter "git rm --cached --ignore-unmatch path/to/BadFile" HEAD
-- si indica WARNING: Ref 'refs/heads/master' is unchanged --> no ha encontrado el fichero ni aplicado cambios, revisar ruta!
-- para poder repetir la operación con más ficheros, sucesivamente borrar las referencias de backup que deja
rm -rf .git/refs/original/
-- para al final aplicar en 'origin': git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment