Interview Prep/Git & GitHub/GitHub, Actions and Pull Request Issues

After your PR was squash-merged, you continued on the same branch; the next PR shows conflicts with your own already-merged changes.

IntermediateTroubleshootingGitHub, Actions and Pull Request Issues
Answer

Likely causes → Squash merge creates a brand-new commit on main; your original commits are not ancestors of main. Git sees them as different changes touching the same lines.

Diagnose →

git log --oneline origin/main..feature     # still lists the commits that were squashed
git cherry -v origin/main feature          # "+" = not found upstream by patch-id

Fix → Rebase only the new commits onto main:

git fetch origin
git rebase --onto origin/main <last-squashed-commit> feature
git push --force-with-lease

Prevent → Start a fresh branch from origin/main after each squash merge, and enable auto-delete of merged head branches.

All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub, Actions and Pull Request Issues