Skip to content

Instantly share code, notes, and snippets.

@ramingar
Last active February 19, 2024 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramingar/ebd740ff8b50e838b251 to your computer and use it in GitHub Desktop.
Save ramingar/ebd740ff8b50e838b251 to your computer and use it in GitHub Desktop.
Comandos git #git #definicion #concepts

git stash # Guarda los cambios actuales en "stash" y hace invisibles los cambios no comiteados

git stash pop # Rescata los cambios guardados en el stash y borra el stash

git stash apply # Hace lo mismo pero conserva el stash

git reset # Marca como unstaged todos lo que estaba staged (los devuelve al estado inicial de cambiado)

git reset HEAD@{1} # Elimina el último commit que tienes en local. Deja todo lo que llevaba ese commit en unstaged

git commit --allow-empty -m "blablabla" # Añade un commit sin archivos modificados (por ej., para obligar a Heroku a hacer rebuild)

git reflog # Lista los commits incluso los eliminados con un hard reset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment