Install_GIT

evabrown2508 Posts 11 Registration date Saturday July 20, 2024 Status Member Last seen October 7, 2024 - Updated on Jul 26, 2024 at 11:01 AM
NHenry Posts 15162 Registration date Thursday March 13, 2003 Status Moderator Last seen October 24, 2024 - Jul 29, 2024 at 07:38 PM

Hello,

What are the differences between "git merge" and "git rebase", and when should each be used?

I often hear about "git merge" and "git rebase" as methods for integrating changes from different branches. Can someone explain the key differences between these two commands and provide examples of scenarios where one would be more appropriate than the other?

1 response

NHenry Posts 15162 Registration date Thursday March 13, 2003 Status Moderator Last seen October 24, 2024
Jul 29, 2024 at 07:38 PM

To explain the difference, I usually use this page : https://girliemac.com/blog/2017/12/26/git-purr/

And when use them, at work, we use :

- "rebase -i" to rewrite the history (compacting the commits usually)

- "rebase" to keep the work i progress branches up to date with the head and avoid many conflicts on merge later

- "merge --no-ff" to make it clear a feature/branch was merged in the current developments trunk.


0