29. Fundindo com o branch main
Metas
- Nós mantivemos nosso branch
styleatualizado em relação ao branchmain(usandorebase), mas agora vamos fundir as modificações de volta nomain.
01 Fundindo style no main
Execute
git switch main
git merge style
Resultado
$ git switch main
Switched to branch 'main'
$ git merge style
Updating 85c14e9..39a1e0f
Fast-forward
css/style.css | 3 +++
hello.html => index.html | 1 +
2 files changed, 4 insertions(+)
create mode 100644 css/style.css
rename hello.html => index.html (73%)
Como o último commit em main precede diretamente o último commit do ramo style, o Git pode fazer a mesclagem rápida simplesmente movendo o ponteiro do ramo para frente, apontando para o mesmo commit do ramo style.
Os conflitos não surgem na mesclagem de avanço rápido. Além disso, as mesclagens de avanço rápido não criam um commit de mesclagem.
02 Confira os logs
Execute
git log --all --graph
Resultado
$ git log --all --graph
* 39a1e0f 2023-11-28 | Renamed hello.html; moved style.css (HEAD -> main, style) [Alexander Shvets]
* 23149b5 2023-11-28 | Included stylesheet into hello.html [Alexander Shvets]
* b9e6de1 2023-11-28 | Added css stylesheet [Alexander Shvets]
* 85c14e9 2023-11-28 | Added meta title [Alexander Shvets]
* ee16740 2023-11-28 | Added README [Alexander Shvets]
* 9288a33 2023-11-28 | Added copyright statement with email [Alexander Shvets]
* b7614c1 2023-11-28 | Added HTML header (tag: v1) [Alexander Shvets]
* 46afaff 2023-11-28 | Added standard HTML page tags (tag: v1-beta) [Alexander Shvets]
* 78433de 2023-11-28 | Added h1 tag [Alexander Shvets]
* 5836970 2023-11-28 | Initial commit [Alexander Shvets]
Agora, as ramificações style e main são idênticas.