Git avanzado - Jesús Amieiro · 2020. 5. 8. · Git avanzado 6. Blame 7. Rebase 8. Squash 9....

Post on 10-Sep-2020

4 views 0 download

Transcript of Git avanzado - Jesús Amieiro · 2020. 5. 8. · Git avanzado 6. Blame 7. Rebase 8. Squash 9....

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

2.1. reset soft

2.2. reset mixed

2.3. reset 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