Chapter practice task
Task: Build a new design on a branch, merge it and fix a conflict on purpose
- Make a mistake on purpose and undo it three different ways.
- Create a
redesignbranch and change the hero section there. - Change the same line on
main, then mergeredesignto create a conflict. - Resolve the conflict, commit and delete the branch.
By the end of this chapter
- You can undo uncommitted and committed changes safely
- You can create, switch and delete branches
- Merge conflicts don’t scare you anymore
Quick answers for this chapter
Can Git lose my work?
Committed work is very hard to lose. Uncommitted changes can be lost with some commands, so commit often.
How many branches should I have?
One per feature or experiment. Delete them after merging.
Are merge conflicts bad?
No. They just mean Git needs a human to choose between two edits.