Merging Branches in Git
Task
Create two diverging lines of development and combine them using merge.
Steps
- Create the
bugFixbranch and switch to it. - Make one commit in
bugFix. - Go back to
mainand make another commit there. - While on
main, merge thebugFixbranch into it.
Expected result
The bugFix branch must stay on its own commit, and main must end with a merge commit that has two parents. HEAD must be on main.
What you will learn
After completing the task, you will be able to:
- create independent changes in two branches;
- merge branches;
- recognize a merge commit by its two parents.
Goal
local