git STASH

  • git stash push : guarda ficheros de *staged area*
    • git stash save [-u | --include-untracked] «<message>» : le da un nombre a la sesión guardada en el stash
    • -u : incluye los ficheros untracked
  • git stash save [-k | --keep-index] «<message>» : guarda en el stash los ficheros del *working copy*
  • git stash list : lista sesiones en el stash
  • git stash show stash@{indice} : muestra los ficheros del stash
  • git stash pop : aplica los cambios en los ficheros guardados anteriormente y los saca del stash
    • git stash apply stash@{indice} : aplica los cambios en los ficheros del stash@{indice} (si hay más de uno)
    • git stash pop stash@{indice} : idem anterior pero elimina la sesión stash
  • git checkout stash@{indice} <fichero> : recupera del stash el fichero indicado
  • git stash drop : borra el primer elemento de la pila
  • git stash drop stash@{indice} : borra la sesión indicada

borra todas las sesiones stash

git stash clear
  • tech/git/stash.txt
  • Darrera modificació: 31/10/2025 11:02
  • per mate