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

  • Home
  • SEARCH
  • 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 3761402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:37:13+00:00 2026-05-19T10:37:13+00:00

In merging my changes against an upstream master, I frequently find myself doing the

  • 0

In merging my changes against an upstream master, I frequently find myself doing the following:

git checkout somefeature
git checkout -b integration
git rebase master # resolving conflicts along the way
git checkout somefeature
git merge integration # or rebase, doesn't matter in this example

I’ll often find that merging the integration branch back into my feature branch fails do to some conflicts. The first question I have is, “why is this happening if my integration branch is a descendent of somefeature and I’ve already resolved conflicts against the upstream master?”

If you’re wondering why I’m using an integration branch to begin with, it’s to prevent polluting my current branch with a half-failed merge.

My current workaround is to do this:

git checkout integration
git branch -f somefeature # overwrite the branch

The problem now is that I can’t push my changes back to a remote branch:

git push origin somefeature
! [rejected]        somefeature -> somefeature (non-fast forward)

So now I have to remove the remote branch and re-push my changes. This can’t be the optimal way to do this, so I’m wondering, “what’s the best way to overwrite a branch and push the changes to a remote 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-19T10:37:14+00:00Added an answer on May 19, 2026 at 10:37 am

    The problem is caused because git rebase generates a new series of commits that aren’t descended from the somefeature branch, then when you try and merge them back into somefeature the conflict resolution done during the rebase doesn’t apply. If you were to just merge instead of rebase then this would work as the merge commit would descend from the somefeature branch.

    In terms of pushing to the remote branch you can just use --force to make the push succeed, that will cause problems for anyone else that has a copy of it though.

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

Sidebar

Related Questions

I have this problem where I'm merging changes up into my integration branch but
Git is smart and will follow changes in history to make merging easier and
In svn, what is the difference between merging changes from a Branch back to
In the projects I work in, it seems the biggest problem with Merging changes
I created a branch and then made changes to trunk which need merging into
I seem to have run into a case where git doesn't notice inline changes
I find the whole process of merging two projects (one committed to SVN the
If you are merging changes from repository B into repository A should you merge
We're hitting a problem when merging in Mercurial where whitespace changes are causing merge
I had a problem with committing changes after merging two branches of my project

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.