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 9215853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:17:44+00:00 2026-06-18T02:17:44+00:00

Say I’m working on a feature in a branch oldFeature . I’ve done commits

  • 0

Say I’m working on a feature in a branch oldFeature. I’ve done commits A and B1 and sent it for the code review. In B1 I changed some existing files but also added newfile.txt.

In the meantime I started working in a branch newFeature, forked from oldFeature (HEAD == B1). I’ve added C, D, E.

Meanwhile, I got code review results and had to amend B1, changing newfile.txt, and also changing some existing files. After the fixes, it became B2.

So to illustrate it:

newFeature   oldFeature
A             A
B1            B2 [B1 with some fixes]
C
D
E

Now I’m in newFeature and I want to rebase newFeature to have B2 instead of B1. When I simply do the rebase, I have rebase a conflict due to newfile.txt being added in both parts of the rebase.

I want to keep the version from oldFeature (B2).

I can’t move B1 to the HEAD, because C, D, E depend on it.

I know I can do the following workaround:

  • git checkout --theirs
  • git add
  • continue rebase

Then I’ll have a situation like this:

newFeature   oldFeature
A             A
B2            B2
BX
C
D
E

where BX is more or less B2\B1 on the files that existed in A.
Now I can do interactive rebase and remove BX.

However my workaround is kind of convoluted. Is there a simpler way to do it? By simpler I mean, that I either have

newFeature   oldFeature
A             A
B2            B2
B2\B1
C
D
E

without any rebase conflicts, and then I can get rid of that B2\B1 commit, or to replace them automatically so I get

newFeature   oldFeature
A             A
B2            B2
C
D
E

Using Git 1.8.0.

  • 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-06-18T02:17:45+00:00Added an answer on June 18, 2026 at 2:17 am

    You could do a rebase interactive:

    git checkout new_feature
    git rebase --interactive old_feature
    

    and drop B1: you simply delete the line with B1:

    # If you remove a line here THAT COMMIT WILL BE LOST
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you write some code like this (using ruby-mode, but I've seen this happen
Say I have classes class A{ //code for class A } class B{ //code
Say we've some strings like these and need the unit from them: 'rotate(90deg)' //
Say i have the following code the event only seems to be firing every
Say I have the following code: #include <iostream> #include <functional> template <int func(int)> struct
Say I have the following code: int foo () { int const x =
Say I have a very simple java object that only has some getXXX and
Say I got this C++ code: class class1{ class2 *x; } class class2{ class1
Say I have this little bit of code: public static void LoadSomething(Type t) {
Say we have the following simple data-frame of date-value pairs, where some dates are

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.