Question: If the changes directly conflicted with each other i.e. another team member made a change to the same line I was editing - what would happen?
Remote: Line 5: "Hello World" → "Hello Python"
Local: Line 5: "Hello World" → "Hello GitHub"
Both you and your teammate edited the same line differently.
$ git pull --rebase origin main
Auto-merging docs/the-soloist.th.md
CONFLICT (content): Merge conflict in docs/the-soloist.th.md
error: could not apply fa419ca... Add explanation image
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply fa419ca... Add explanation image# 🏃 นักเดี่ยว

<<<<<<< HEAD
นักเดี่ยวชอบทำงานคนเดียว (Remote version - from teammate)
=======
The Soloist prefers working alone (Your local version)
>>>>>>> fa419ca (Add explanation image)What Git Added:
<<<<<<< HEAD- Start of remote version (what's on GitHub)=======- Separator>>>>>>> fa419ca- End of your local version
Step 1: Open the conflicted file and choose what to keep:
# Before (with conflict markers):
<<<<<<< HEAD
นักเดี่ยวชอบทำงานคนเดียว
=======
The Soloist prefers working alone
>>>>>>> fa419ca
# After (you decide):
นักเดี่ยวชอบทำงานคนเดียว
# OR
The Soloist prefers working alone
# OR combine both
นักเดี่ยวชอบทำงานคนเดียว (The Soloist prefers working alone)Step 2: Remove the conflict markers (<<<<<<<, =======, >>>>>>>)
Step 3: Mark as resolved:
git add docs/the-soloist.th.mdStep 4: Continue the rebase:
git rebase --continuegit checkout --theirs docs/the-soloist.th.md
git add docs/the-soloist.th.md
git rebase --continuegit checkout --ours docs/the-soloist.th.md
git add docs/the-soloist.th.md
git rebase --continuegit rebase --abort # Goes back to before you startedIf you and a teammate both edited the same line in the-soloist.th.md:
  <<<<<<< HEAD

=======

>>>>>>> fa419caYou'd need to decide:
- Keep 002? Keep 003? Use both? Pick a different number?
| Conflict Type | Example | Difficulty |
|---|---|---|
| Same line edited | Both changed line 5 | |
| One deleted, one edited | You edited, they deleted | |
| Both added different content | Both added new sections | |
| Different files | You edited A, they edited B | ✅ No conflict! |
| Different lines same file | You edited line 5, they edited line 20 | ✅ No conflict! |
- Pull often -
git pull --rebase origin mainfrequently - Small commits - Commit and push smaller changes more often
- Communicate - Tell team when working on same files
- Feature branches - Work on separate branches for big changes
- Review before pushing - Check
git statusandgit diff
No conflicts (your case): ✅ Automatic merge - both changes included seamlessly
With conflicts:
⚠️ Git stops and asks you to decide- 👀 You manually review and choose
- ✏️ Edit file to resolve
- ✅ Mark resolved with
git add ▶️ Continue withgit rebase --continue
Remote (origin/main): A -- B -- C -- D
\
Local (main): \-- X
- Remote has commits B, C, D
- You have local commit X
Remote + Local: A -- B -- C -- D -- X
↑
(main)
- ✅ All remote changes are pulled (commits B, C, D)
- ✅ Your local changes are "replayed" on top (commit X)
- ✅ Result: Linear history with everything included
Key Point: Yes, both local AND remote changes are in the final version! Rebase just makes a cleaner, linear history by putting your changes on top instead of creating a merge commit.
Think of it like this:
- 🔄 Rebase = "Take my changes and replay them on top of the latest remote"
- 🔀 Merge = "Combine both branches with a merge commit"
Both keep all changes, just organized differently!
The good news: VS Code has great conflict resolution UI with buttons to:
- ✅ Accept Current Change (your version)
- ✅ Accept Incoming Change (remote version)
- ✅ Accept Both Changes
- ✅ Compare Changes (side-by-side view)
This makes resolving conflicts much easier than manual editing!