PrácticaBloque 3 · Ramas y conflictos
Un fast-forward y un merge commit
Punto de partida
Rama agrega-contacto, con los dos commits de las prácticas anteriores.
Pasos
- Fast-forward: la respuesta debe incluir
Fast-forward.
git switch main
git merge agrega-contacto
- Crea otra rama con un archivo nuevo:
git switch -c agrega-sede
echo "Sede: ITH" > sede.txt
git add sede.txt
git commit -m "Agrega sede"
- Regresa a
mainy haz un commit ahí también (sinotas.txtno existe, elecholo crea):
git switch main
echo "Revisar sede con el comité" >> notas.txt
git add notas.txt
git commit -m "Agrega pendiente de sede"
- Mira los dos caminos que salen del mismo commit:
git log --oneline --graph --all
- Merge commit: VS Code abre el mensaje
Merge branch 'agrega-sede'; ciérralo sin cambiar nada.
git merge agrega-sede
git log --oneline --graph --all
Comprobación
El log muestra un commit Merge branch 'agrega-sede' con dos líneas que llegan a él, y más abajo la línea recta del fast-forward.