How to Merge a Feature Branch PR into the dev Branch Without Conflicts
This guide walks through a zero‑conflict workflow for merging a feature branch into the dev branch, covering local finalization, pulling the latest dev, merging locally, pushing the feature branch, and creating a GitHub pull request with the correct base and compare settings.
Complete Standard Process (Follow Exactly for Zero Conflicts)
1. Finish Locally (Most Important to Avoid PR Conflicts)
Save all development changes and synchronize with the latest dev code before creating a pull request.
# 1. Save all your development code
git add .
git commit -m "feat: complete A feature development"
# 2. Switch to dev and pull the latest remote code (crucial to prevent conflicts)
git checkout dev
git pull origin dev
# 3. Switch back to your feature branch and merge the latest dev code
git checkout feature/A
git merge devResolve any conflicts locally to ensure the PR is clean.
2. Push the Local Branch to Remote
git push origin feature/A3. Create the PR on GitHub
Base (target branch): dev
Compare (source branch): feature/A
After selecting the correct base and compare branches, submit the pull request.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
liandk
Seasoned Java and mobile developer with years of experience, specializing in mini‑programs, public accounts, and full‑stack front‑end development. In the AI era, I continuously learn to broaden my knowledge and evolve. I revived a public account I started a decade ago during a dessert‑startup venture, using code as a vessel and knowledge as a companion. I share personal projects, technical articles, programming tips, and growth insights—let’s improve together and set sail.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
