Menu
Coddy logo textTech

Update Main In Parallel

Part of the Version Control section of Coddy's Terminal journey — lesson 53 of 58.

Meanwhile on main, the docs need a small fix that is unrelated to the feature work.

Updating both branches in parallel is the most realistic scenario, and the merge in the next lesson will be a true three-way merge instead of a fast-forward.

challenge icon

Challenge

Easy

Switch back to main (the feature branch already has the new commit). Append the line This is the project readme. to readme.md, then stage and commit with the message Expand readme.

Print the contents of readme.md.

Cheat sheet

Working on multiple branches in parallel enables true three-way merges (as opposed to fast-forward merges that occur when only one branch has new commits).

Switch between branches with:

git checkout branch-name

Each branch tracks its own commits independently, allowing parallel development.

Try it yourself

Terminal
git init -q -b main
git config user.name "Todo Dev"
git config user.email "todo@coddy.tech"
git add .
git commit -q -m "Seed todo list"
git switch -q -c add-task
echo "walk the dog" >> todo.txt
git add todo.txt
git commit -q -m "Add walk task"
cat todo.txt
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Version Control