Thinking on hiring me?

Please read

Fernando Guillén

a Freelance Web Developer

cabecera decorativa

software development as an artistic expression

Shell: script para borrar todos los delete pendientes con GIT

Tengo la mala costumbre de borrar los ficheros desde mi editor de texto así que cuando vuelvo a consola y hago un ‘git status‘ me salen un montón de ficheros borrados y no encuentro el comando de ‘git‘ para decirle: cárgatelos todos en el próximo commit.

Así que me he hecho este script para decirle exactamente eso:

$ git rm `git status | grep "deleted" | cut -f 2 -d ":" | cut -d " " -f 5`

Cuidadín con él eh :).. a ver si no va a estar bien..

Actualización: como dice Juanma en los comentarios podemos hacerlo mucho más elegantemente con:

git add -u
2 Comments to “Shell: script para borrar todos los delete pendientes con GIT”
  1. Juanma Says:

    Prueba con
    git add -u

  2. fguillen Says:

    Genial @Juanma Gracias:

    -u

    Update only files that git already knows about, staging modified content for commit and marking deleted files for removal. This is similar to what “git commit -a” does in preparation for making a commit, except that the update is limited to paths specified on the command line. If no paths are specified, all tracked files in the current directory and its subdirectories are updated.

Leave a comment

You must be logged in to post a comment.

a Freelance Web Developer is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

Creative Commons License
Fernando Guillen's blog by Fernando Guillen is licensed under a Creative Commons Attribution-NoDerivs 3.0 Unported License.