GitHub: conflict resolution
This course covers merge conflicts on a branch that sits in an open pull request, already under review. It explains GitHub's web-based conflict editor and its limits, and the local path for conflicts the editor can't handle. It shows why a force-push after a rebase marks review comments as outdated, and why a merge-based fix keeps them current. It also covers checking out and reviewing someone else's conflicted PR, preventing conflicts with git rerere and small branches, and two scenarios on this repository's db/seeds.rb.
What you'll learn
- ✓Using GitHub's Resolve conflicts editor and what Commit merge does
- ✓Resolving a PR conflict locally and pushing it back with git push or --force-with-lease
- ✓Why force-pushing a rebase marks review comments as outdated
- ✓Checking out another person's PR with pull/<number>/head or gh pr checkout
- ✓When a reviewer should resolve a conflict and when to leave a comment
- ✓Reducing conflicts with git rerere, branch protection, small PRs and draft PRs
This course's scope: conflicts inside an open pull request
"Git merging & conflicts" showed what a conflict is: both sides change the same lines differently, and Git refuses to guess. It also showed how to read and resolve one, editing the three markers (<<<<<<< HEAD, =======, >>>>>>> branch-name) by hand until they're gone. "GitHub pull requests" then…
Read the full lesson free →Curriculum
7 lessonsThis course's scope: conflicts inside an open pull request
Sets the scope: conflicts on a branch in an open, reviewed pull request when main moves underneath it.
GitHub's web-based conflict editor
Shows GitHub's in-browser conflict editor, its limit to simple line changes, and the merge commit Commit merge pushes.
When resolving locally is the only option
Reproduces a PR conflict locally, resolves it, and sends it back with git push or git push --force-with-lease.
What a force-push does to a review in progress
Explains why a rebase force-push marks review comments outdated and why merges and follow-up commits avoid this.
Reviewing someone else's conflicted pull request
Checks out a teammate's PR via pull/<number>/head or gh pr checkout and weighs whether a reviewer should resolve it.
Keeping PRs conflict-free: rerere and small branches
Introduces git rerere to reuse recorded resolutions, plus branch protection, small PRs and draft PRs to prevent conflicts.
Putting it together: a conflict on this repository's db/seeds.rb
Applies the web editor, the local path, rerere and reviewer tools to two conflict scenarios on db/seeds.rb.