Merge add-dogs into main

In this step, we will demonstrate a true merge with successful auto-merging by merging the branch add-dogs into main.

The reason that this will be a true merge, versus as fast-forward merge, is because main is not an ancestor of add-dogs. Run the gloga command to confirm this fact.

The reason that auto-merge will be successful is that the set of files modified on the fix-bug branch has no files in common with the set of files modified on the add-dogs branch.

You should already be on the main branch. (If not, switch to it.)

Merge add-dogs into main:

git merge add-dogs

Because a true merge is completing successfully, a new commit will be created. You will be prompted to enter a log message and a default message will be provided. To accept the default message, press Ctrl-X (to exit the editor), press Y (to confirm saving the log message), and press Enter (to confirm the location to save to).

Note from the output of the command that auto-merging occurred and was successful.

Run the gloga command.

Note the new commit that was created and how it merged together two commits. Also, note that the commit history of main now includes both the fix-bug and add-dogs branches; however, it does not include add-cats.


⏴ Back Next ⏵