Stage 5 · Lesson 7 of 8
Resolving conflicts calmly
A happens when two change the same lines and cannot decide which version wins. Git stops and marks the file with conflict markers: <<<<<<<, ======= and >>>>>>>. Between them you see both versions.
Edit the file until it holds the correct final code, and delete the markers. Then git add the file and continue with git commit or git rebase --continue. shows buttons to accept one side or the other, but you still need to think about what the code should do.
Run the tests afterwards. If things go wrong, git merge --abort or git rebase --abort takes you back to where you started.
Common trapaccepting "ours" everywhere and silently deleting a teammate's work.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- BookFreePro Git
Scott Chacon and Ben Straub
The free official Git book; chapters 2 and 3 cover everything in this stage properly
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
The version control lecture teaches Git from its data model upwards, which makes commands make sense
Practise
Keep handy
Also worth your time
- roadmap.sh: Git and GitHubGo deeper
A map of Git and GitHub topics, from basics to hooks, submodules and Actions