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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:19:20+00:00 2026-05-19T04:19:20+00:00

I want to remove an in-between merge (remove, not squash) and then move the

  • 0

I want to remove an in-between merge (remove, not squash) and then move the last 2 commits to a new branch.

This is my current git log --graph:

* 3a5c453 - (2 hours ago) last commit (HEAD, master)
*   b6c19f1 - (2 hours ago) Merge branch 'tade' into HEAD
|\  
* | be356d0 - (2 hours ago) previous commit
| * 65328dc - (3 hours ago) some other commit in branch tade

I want to end up with this:

    * bbbbbbb - (some time in the future) a later commit on tade (tade)
*   | aaaaaaa - (some time in the future) a later commit on master (master)
| * | 3a5c453 - (2 hours ago) last commit (HEAD, newone)
| * | be356d0 - (2 hours ago) previous commit
|/  |
|   * 65328dc - (3 hours ago) some other commit in branch tade

I thought of using git rebase -i to remove the merge with the branch tade and then do a git branch newone and git reset --hard HEAD^2 to move the last 2 commits to the new branch. When I did the rebase though, it showed me all the commits from the tade branch that got merged into master and | was reluctant in deleting them.

Is there a better way or should I go ahead with it?

EDIT: I updated the intended state graph to make it more clear. The 2 new commit (aaaaaaa and bbbbbbb) are only there to illustrate the state a little better (I hope)

  • 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-19T04:19:21+00:00Added an answer on May 19, 2026 at 4:19 am

    Use interactive rebasing to rebase 3a5c453 on be356d0 instead of the merge commit b6c19f1 (i.e. just move the 3a5c453 commit one down). Then you should have something like this:

    *   xxxxxxx - (2 hours ago) Merge branch 'tade' into HEAD
    |\  
    * | yyyyyyy - (2 hours ago) last commit (HEAD)
    * | be356d0 - (2 hours ago) previous commit
    | * 65328dc - (3 hours ago) some other commit in branch tade
    

    Then you can just create new branches:

    git checkout -b newbranch yyyyyy
    

    Then you can delete xxxxxx and commit something to the master and end up with this:

    * zzzzzz - new commit on master
    | * | yyyyyyy - (2 hours ago) last commit (HEAD)
    | * | be356d0 - (2 hours ago) previous commit
    | | * 65328dc - (3 hours ago) some other commit in branch tade
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to iphone Development.I want to remove excess blank space in between
i have a label tag and i want to remove text between <label> </label>
I want to remove the whitespace between the arrays, but I've used different codes
I want to remove the space between the axes of the plot and the
I want to remove the last right border in a row of links? #mainMenu
I merged the wrong way between two branches. I then ran the following: git
I want to remove splits (gaps) between buttons in UISegmentedControl . Segmented control is
I have the following code. I want to remove the space between the buttons
I've got a string of data, and I want to remove the content between
I have a text in this format: term: 156:59 datainput I want to remove

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.