Git avanzado - 2020.spain.wordcamp.org … · • git pull Repositorios remotos. 2 - reset....

Preview:

Citation preview

Git avanzadoJesús Amieiro

1. Git2. Reset3. Cherry pick4. Stash5. Bisect

Git avanzado6. Blame7. Rebase8. Squash9. Reflog

1 - Git

Equipo 1

V 1

V 2

V 3

Equipo 2

V 1

V 2

V 3

Equipo 3

V 1

V 2

V 3

Servidor

V 1

V 2

V 3

Commit

Commit 160bitsFunción SHA-1

75528b9

Commit 1

75528b9

Commit 1

8daf16a

Commit 2

75528b9

Commit 1

8daf16a

Commit 2

a346348

Commit 3

Directorio de trabajo

Zona de preparación Repositorio

Preparar archivos

Commit

Checkout

Con seguimientoSin

seguimientoSin

modificación Modificado

Añadir archivo

Edición

Commit

Preparado

75528b9

Commit 1

8daf16a

Commit 2

de396a3

Commit 5

a3ae45c

Commit 3

456af81

Commit 4

pruebas

master

HEAD

• git clone• git remote• git push• git fetch• git pull

Repositorios remotos

2 - reset

Directorio de trabajo

Zona de preparación Repositorio

softmixed

hard

reset1. soft

reset2. mixed

reset3. hard

3 - cherry-pick

75528b9

Commit 1

8daf16a

Commit 2

de396a3

Commit 5

a3ae45c

Commit 3

456af81

Commit 4

feature-1

master

HEAD

$ git checkout master$ git cherry-pick 456af81

git cherry-pick

75528b9

Commit 1

8daf16a

Commit 2

de396a3

Commit 5

a3ae45c

Commit 3

456af81

Commit 4

feature-1

master

ad358e1

HEAD

Commit 6

Cherry pick1. Ejemplo básico

• 2 o más commits• Editar el mensaje de commit: -e• Aplicar el contenido sin hacer el

commit

git cherry-pick

Cherry pick2. Aplicar el contenido

sin hacer el commit

4 - stash

5 - bisect

6 - blame

7 - rebase

7.1 – merge fast forward

7.2 – merge recursive

7.3 – rebase

8 - squash

9 - reflog

Preguntas