Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
clase:daw:daw:2eval:tema06 [2021/11/16 20:19] admin [Usando Ramas] |
clase:daw:daw:2eval:tema06 [2024/01/02 10:07] (actual) admin [Usando Ramas] |
||
---|---|---|---|
Línea 14: | Línea 14: | ||
{{: | {{: | ||
+ | {{: | ||
Ejemplo de Ramas | Ejemplo de Ramas | ||
Línea 52: | Línea 53: | ||
<sxh bash> | <sxh bash> | ||
git branch nuevaRama | git branch nuevaRama | ||
- | git checkout | + | git switch nuevaRama |
- | git push -u origin nuevaRama | + | git push --set-upstream origin |
+ | git push -u | ||
</ | </ | ||
Línea 62: | Línea 64: | ||
<sxh bash> | <sxh bash> | ||
git fetch --prune | git fetch --prune | ||
- | git checkout | + | git switch |
</ | </ | ||
<note tip> | <note tip> | ||
* '' | * '' | ||
- | * '' | + | * '' |
</ | </ | ||
Línea 124: | Línea 126: | ||
Se usa para poner los commits de origin/ | Se usa para poner los commits de origin/ | ||
- | |||
{{: | {{: | ||
+ | |||
+ | |||
+ | '' | ||
+ | < | ||
+ | %%{init: { ' | ||
+ | gitGraph | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | </ | ||
\\ | \\ | ||
+ | '' | ||
+ | < | ||
+ | %%{init: { ' | ||
+ | gitGraph | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | '' | ||
+ | \\ | ||
+ | '' | ||
+ | < | ||
+ | %%{init: { ' | ||
+ | gitGraph | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | </ | ||
==== git merge --squash rama ==== | ==== git merge --squash rama ==== | ||
Línea 147: | Línea 193: | ||
\\ | \\ | ||
+ | |||
+ | < | ||
+ | %%{init: { ' | ||
+ | gitGraph | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | '' | ||
+ | < | ||
+ | %%{init: { ' | ||
+ | gitGraph | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | '' | ||
+ | < | ||
+ | %%{init: { ' | ||
+ | gitGraph | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
==== git merge rama ==== | ==== git merge rama ==== | ||
Línea 162: | Línea 246: | ||
<sxh bash> | <sxh bash> | ||
git fetch --prune | git fetch --prune | ||
- | git checkout | + | git switch |
git merge --ff-only origin/ | git merge --ff-only origin/ | ||
git fetch --prune | git fetch --prune | ||
- | git checkout | + | git switch |
git merge --ff-only origin/ | git merge --ff-only origin/ | ||
git fetch --prune | git fetch --prune | ||
- | git checkout | + | git switch |
git merge --ff-only origin/ | git merge --ff-only origin/ | ||
</ | </ | ||
Línea 181: | Línea 265: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
git merge --ff-only develop | git merge --ff-only develop | ||
- | git checkout | + | git switch |
git merge --ff-only release | git merge --ff-only release | ||
</ | </ | ||
Línea 196: | Línea 280: | ||
<sxh bash> | <sxh bash> | ||
git fetch --prune | git fetch --prune | ||
- | git checkout | + | git switch |
git rebase origin/ | git rebase origin/ | ||
</ | </ | ||
Línea 218: | Línea 302: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
git merge --squash lorenzo_42 | git merge --squash lorenzo_42 | ||
git commit -am " | git commit -am " | ||
Línea 232: | Línea 316: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
git merge develop | git merge develop | ||
Línea 362: | Línea 446: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
git rebase origin/ | git rebase origin/ | ||
vi index.html | vi index.html | ||
Línea 392: | Línea 476: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
git merge --squash Lorenzo_3 | git merge --squash Lorenzo_3 | ||
vi index.html | vi index.html | ||
Línea 417: | Línea 501: | ||
</ | </ | ||
- | Ahora debemos como antes arreglar el conflicto editando el fichero '' | + | Ahora debemos como antes arreglar el conflicto editando el fichero '' |
<sxh bash> | <sxh bash> | ||
+ | git add index.html | ||
git merge --continue | git merge --continue | ||
</ | </ | ||
+ | | ||
+ | Es decir añadir el fichero que ha dado el conflicto con un '' | ||
+ | |||
Línea 427: | Línea 516: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
git merge develop | git merge develop | ||
vi index.html | vi index.html | ||
+ | git add index.html | ||
git merge --continue | git merge --continue | ||
</ | </ | ||
\\ | \\ | ||
- | ===== Stash ===== | ||
- | Hay veces que queremos guardar temporalmente los cambios para despues volver a ellos, por ejemplo si queremos cambiar de rama. | ||
- | |||
- | git contiene una orden para hacer eso: | ||
- | <sxh bash> | ||
- | git stash | ||
- | </ | ||
- | |||
- | Y si luego queremos recuperar los cambios se hace con: | ||
- | |||
- | <sxh bash> | ||
- | git stash pop | ||
- | </ | ||
===== Recetas ===== | ===== Recetas ===== | ||
Línea 453: | Línea 530: | ||
<sxh bash> | <sxh bash> | ||
- | git fetch --prune && git checkout | + | git fetch --prune && git switch |
</ | </ | ||
Línea 459: | Línea 536: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
</ | </ | ||
Línea 465: | Línea 542: | ||
<sxh bash> | <sxh bash> | ||
- | git checkout | + | git switch |
</ | </ | ||