Fundamentals 2 min read

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.

liandk
liandk
liandk
How to Merge a Feature Branch PR into the dev Branch Without Conflicts

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 dev
Resolve any conflicts locally to ensure the PR is clean.

2. Push the Local Branch to Remote

git push origin feature/A

3. 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

workflowGitfeature-branchmerge-conflictpull-requestdev-branch
liandk
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.