One way of combining data from two branches is to use merging tool. Merge can be done by fast-forward
or by recursive-strategy
. Fast-forward
is used when commits on a branch we want to merge to the current one are directly ahead of current HEAD. Git just moves pointer to the last commit. In other cases git looks for a common ancestor in two branches and starts from there trying to add changes to current branch. Sometimes this may result in conflicts which need to be resolved. Merging tool can be used by git mergetool
.
This is the second way of integrating data of branches. Rebase works little different than merge. After merge git history shows that there was parallel work done, with rebase it looks like its continous. Rebase works by going to the common ancestor of the two branches (the one you’re on and the one you’re rebasing onto), getting the diff introduced by each commit of the branch you’re on, saving those d