Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7541221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:50:19+00:00 2026-05-30T07:50:19+00:00

I have a project with a dev branch and a production branch. Recently I’ve

  • 0

I have a project with a dev branch and a production branch. Recently I’ve been working on a big new set of features in dev, so I haven’t merged into production for about two weeks. In the meantime, though, there were some bugs that needed to be fixed in production.

For the most part I was able to make the fixes in dev and cherry-pick them into production. Sometimes, however, I would need to fix production by hand, as the fixes were substantially different in the two branches. Point is, the two branches have diverged a fair bit since they split.

Now I want to just push all of dev into production. I don’t care about keeping any of the commits in production since the split, I just want production to look exactly like dev. [EDIT: I want production to look exactly like dev since the split, but don’t want to rewrite history before the split] However, when I try to merge I get dozens of conflicts that I’d prefer not to fix by hand.

What’s the best way to force a merge in git? Can I revert my production changes back to the split and then just fast-forward to the dev branch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:50:19+00:00Added an answer on May 30, 2026 at 7:50 am

    You can just push your dev branch onto the master repo production branch:

    git push --force upstream-remote dev:production
    

    upstream-remote may just be origin if you’re on a default clone.

    Updated for mod’ed question:

    You probably don’t want to revert in the git sense but, yes, that’s more or less what you want to do. Something like

    git checkout -b merge <split hash>
    git merge dev
    git push --force origin merge:production
    

    <split hash> was the last commit on production that you want to keep.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started managing a project on GitHub where people have been submitting pull
I have project Emle in Launchpad . I set it to import from emle.svn.sourceforge.net
i have an open source ruby project on github, where my master branch represents
I have a project that currently compiles happily on my dev machine using VS
Consider this scenario. I have a small enterprise project dev environment. We use archiva
I'm working on 2d game dev project. It's some kind of board game. As
I already have a production instance deployed on the server. Its working well. Here
We have currently just master branch. Our current workflow involves implementing the features locally,
We have a project and are about to add a new piece of functionality
First a bit of background. I have been working on the MS platform for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.