Stage 2 · Lesson 5 of 8
Merge conflicts
A happens when two changed the same lines and cannot choose for you. It stops and marks the file with conflict markers, <<<<<<<, ======= and >>>>>>>, around the two versions. git status lists the files in conflict.
To resolve it, edit the file to the version you actually want, which may combine both sides. Delete the markers, then run git add and git commit to finish. Run the program or the tests before committing, because a fix that compiles can still be wrong.
git merge --abort takes you back to before the merge if you get lost. Conflicts are normal, not a sign that you broke something, and small, frequent merges keep them small.
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
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
MIT lectures on dev tools; the shell, shell tools and version control lectures are enough
- GitHub repoFreeGitHub Skills: Introduction to GitHub
GitHub · Beginner
Free one-hour exercise: branch, commit, open and merge a pull request