You can't learn Git by reading. You have to type the commands yourself. Open your terminal and follow every step below. If you skip this, you'll forget everything by tomorrow.
This exercise deliberately creates a conflict so you can practice resolving it. Do this at least twice until it feels routine.
# On main, edit line 3 of LoginTest.java
git checkout main
# Edit LoginTest.java — change the class comment to "Version A"
git add LoginTest.java
git commit -m "Update LoginTest comment — version A"
# Create a new branch from BEFORE that commit
git checkout -b conflict-branch HEAD~1
# Edit the SAME line of LoginTest.java — change to "Version B"
git add LoginTest.java
git commit -m "Update LoginTest comment — version B"
# Try to merge — this WILL conflict
git checkout main
git merge conflict-branch
# CONFLICT! Now resolve it using the steps from lesson 6.Intentionally creating merge conflicts is the best way to get comfortable with them. You WILL encounter them in your job — better to learn now than panic during a real deadline.
Key Point: Hands-on practice is the only way to learn Git. Do these exercises until every command feels natural.