๐ญ๐ก๐ ๐๐ข๐๐๐๐ซ๐๐ง๐๐๐ฌ between ๐๐ข๐ญ ๐๐๐ซ๐ ๐ and ๐๐ข๐ญ ๐๐๐๐๐ฌ๐.
Nguyen Hoang
Posted on October 23, 2024
Let me tell you ๐ญ๐ก๐ ๐๐ข๐๐๐๐ซ๐๐ง๐๐๐ฌ between ๐๐ข๐ญ ๐๐๐ซ๐ ๐ and ๐๐ข๐ญ ๐๐๐๐๐ฌ๐.
๐๐ฉ๐ฆ๐ฏ ๐ธ๐ฆ ๐ฆ๐๐ซ๐ ๐ ๐๐ก๐๐ง๐ ๐๐ฌ ๐ง๐ณ๐ฐ๐ฎ ๐ฐ๐ฏ๐ฆ ๐๐ช๐ต ๐ฃ๐ณ๐ข๐ฏ๐ค๐ฉ ๐ต๐ฐ ๐ข๐ฏ๐ฐ๐ต๐ฉ๐ฆ๐ณ, ๐ธ๐ฆ ๐ค๐ข๐ฏ ๐ถ๐ด๐ฆ โ๐จ๐ช๐ต ๐ฎ๐ฆ๐ณ๐จ๐ฆโ ๐ฐ๐ณ โ๐จ๐ช๐ต ๐ณ๐ฆ๐ฃ๐ข๐ด๐ฆโ.
๐๐ฉ๐ฆ ๐ฅ๐ช๐ข๐จ๐ณ๐ข๐ฎ ๐ฃ๐ฆ๐ญ๐ฐ๐ธ ๐ด๐ฉ๐ฐ๐ธ๐ด ๐ฉ๐ฐ๐ธ ๐ต๐ฉ๐ฆ ๐ต๐ธ๐ฐ ๐ค๐ฐ๐ฎ๐ฎ๐ข๐ฏ๐ฅ๐ด ๐ธ๐ฐ๐ณ๐ฌ.
๐๐ข๐ญ ๐๐๐ซ๐ ๐
This creates a new commit Gโ in the main branch. Gโ ties the histories of both main and feature branches.
Git merge is ๐ง๐จ๐ง-๐๐๐ฌ๐ญ๐ซ๐ฎ๐๐ญ๐ข๐ฏ๐. Neither the main nor the feature branch is changed.
๐๐ข๐ญ ๐๐๐๐๐ฌ๐
Git rebase moves the feature branch histories to the head of the main branch. It creates new commits Eโ, Fโ, and Gโ for each commit in the feature branch.
The benefit of rebase is that it has ๐ฅ๐ข๐ง๐๐๐ซ ๐๐จ๐ฆ๐ฆ๐ข๐ญ ๐ก๐ข๐ฌ๐ญ๐จ๐ซ๐ฒ.
Rebase can be dangerous if โthe golden rule of git rebaseโ is not followed.
๐๐ก๐ ๐๐จ๐ฅ๐๐๐ง ๐๐ฎ๐ฅ๐ ๐จ๐ ๐๐ข๐ญ ๐๐๐๐๐ฌ๐
Never use it on public branches!
Posted on October 23, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.