Lesson03
beginnerThree-Way Merge
Goal
Merge two branches that have both moved on, creating a merge commit.
While you built the login form on feature/login, someone updated the homepage on main. The history has split, so a fast-forward is impossible: Git has to combine both sides.
You are currently on feature/login.
Objectives
0/3- Switch to
main, the branch that should receive the login work. (Current objective) - Merge
feature/loginintomain. (Not started) - Find the new merge commit, with two parents, at the top of the graph. (Not started)
Your task nowStep 1 of 3
Switch to main, the branch that should receive the login work.
Need help?
Reference
A merge commit
$ git merge feature/login
Merge made by the 'ort' strategy. login.css | 3 +++ login.js | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 login.css create mode 100644 login.js
Git combined both branches in a new commit with the message Merge branch 'feature/login'. It has two parents: main's previous commit and feature/login's.
What you are about to build
Preparing your workspace…
Repository Graph
Click a commit to inspect it
Working Tree
Not a Git repository yet
No unstaged changes
Your working tree matches the staging area.
Staging Area
Files prepared for the next commit
No staged changes
Use git add to prepare files for your next commit.
Repository
Committed history
No commits yet
Use git commit to record staged changes.
