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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:04:38+00:00 2026-06-08T13:04:38+00:00

Working on a project with git, I have two feature branches, call them dev-a

  • 0

Working on a project with git, I have two feature branches, call them dev-a and dev-b, branched from my develop branch (which is branched from master).

I worked on dev-a for a bit, finished it, and merged it back into develop, did a little work on develop, and started on dev-b, worked for a bit, then found something that should have been done on dev-a, so I checkout dev-a, and fix it. My DAG now looks like this:

commit hashes are obviously made up and not real hashes; they’re just for reference

*   008 - (dev-a) Fix problem on dev-a
|
| * 007 - (dev-b) Work on dev-b
| * 006 - Work on dev-b
| |
| * 005 - (develop) Work on develop
| * 004 - Work on develop
| * 003 - Merged dev-a
|/|
* | 002 - Work on dev-a
* | 001 - Work on dev-a
 \|
  * 000 - Work on develop
  |

What I want to do, though, is have that commit happen “before” the merge, so that I can rebase develop and dev-b on top of it, keeping everything neat and tidy:

  * 007 - (dev-b) Work on dev-b
  * 006 - Work on dev-b
  |
  * 005 - (develop) Work on develop
  * 004 - Work on develop
  * 003 - Merged dev-a
 /|
* | 008 - (dev-a) Fix problem on dev-a
* | 002 - Work on dev-a
* | 001 - Work on dev-a
 \|
  * 000 - Work on develop
  |

It’s also important to note that the fix for dev-a won’t conflict with any later commits – it’s a fairly small change to a single file. All of the relevant commits are local and haven’t been shared.

I’m fairly certain I can do this, as git is fairly flexible, but I don’t know for sure if it’s possible, how to do it, or whether it’s a good idea.

  • 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-08T13:04:39+00:00Added an answer on June 8, 2026 at 1:04 pm

    This is all very straightforward, just do the merge again and rebase everything against it.

    # make a branch of the 'develop' right before the merge
    git checkout -b new-base 000 
    # merge again
    git merge dev-a
    
    git checkout develop
    # it moves all 'develop' commits made after the merge onto the new base.
    git rebase new-base
    
    git checkout dev-b
    # moves all 'dev-b' commits onto the rebased 'develop'.
    git rebase develop
    
    # drop it, I don't think it has any value now.
    git branch -d new-base
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large-ish project that I'm working on which uses git as the
I have two branches A and B in a project that I am working
I have two branches to my project, master and test branches . when I'm
I have a project with a dev branch and a production branch. Recently I've
I have a small project on git, on which I am the sole developer.
We have been trying to get git-subtree working on a project (with git version
I have a git project that I'm working on locally. It's a PHP project
I am planning on deploying git for a project I am currently working on
Git's tab autocompletion is useful for small projects, but I'm currently working on two
I have a working project that Im amending, it crashes after trying to use

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.