Historia

Revisar

Podemos revisar la información de commits con git log. Ejemplos:

//orden básica
git log 
//últimas 5 revisiones
git log -5
//poniendo información en una línea
git log --pretty=oneline
git log --oneline

Revisando estados antiguos

  • Con git checkout podemos recuperar el repositorio o ficheros determinado en un estado anterior.
  • Recuperamos un fichero
    git checkout <commit> <file>
    
  • O todo el repositorio

    git checkout <commit>
    
  • Veamos un ejemplo

git log --oneline
//resultado de lo anterior
b7119f2 Continue doing crazy things
872fa7e Try something crazy
a1e8fb5 Make some important changes to hello.py
435b61d Create hello.py
9773e52 Initial import


//recuperando el tercer commit.
git checkout a1e8fb5

Deshacer cosas:

Sacar un fichero del estado preparado:

git reset HEAD <file>

Deshacer cambios sobre un fichero. Ojo que no hay quien los recupere después:

git checkout -- <file>

Tagging

  • Consiste en poner nombre a un commit.

https://confluence.atlassian.com/bitbucket/use-repo-tags-321860179.html

results matching ""

    No results matching ""