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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:32:36+00:00 2026-05-26T08:32:36+00:00

I have a following situation: root — A — D ————- H ——master \

  • 0

I have a following situation:

root -- A -- D ------------- H ------master
    \          \              \
     \          \              \
      - B -- C -- E -- F -- G -- I -- J -- dev

Commit ‘F’ contains an bugfix that at first seemed to be unrelated to master branch, but after few weeks it proved to be important. Everything was already commited and pushed.

But another problem is that ‘F’ commit contains a few changes and only one of them is relevant to master. So what I would want to is:

  • Split F into 2 separate commits (one for relevant change [F1], another for other [F2])
  • Merge F1 with master

I don’t need to change dev branch history.

Can I do anything besides manual diff + patch?

I imagine something like

root -- A -- D ------------- H ---K--master
    \          \      /-------\--/    
     \          \  /-F1-F2-\   \-----\        
      - B -- C -- E ------- F -- G -- I -- J -- dev

(sorry for sloppy line art)

  • 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-26T08:32:37+00:00Added an answer on May 26, 2026 at 8:32 am

    I would do the following: first cherry-pick commit F with --no-commit to your master branch, then stage the changes you need in master, drop everything else. I know it does not sound like the perfect solution, but when merging F to master, you would also get all ancestor commits of F (from dev branch: E C B):

    git checkout master
    git stash
    git cherry-pick --no-commit F
    git reset && git add -p
    # alternatively reset already staged changes:
    git reset -p
    git commit
    git reset --hard
    git stash pop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following situation: I have a certain function that runs a loop
So I have the following situation. I have a configuration class config.py that holds
Let's say that I have following situation. I have many customers and many consultans,
I have the following situation: There is a windows folder that has been mounted
Situation: I have a simple XML document that contains image information. I need to
Consider the following situation: There is an xml that contains data @XmlData The @XmlData
I have strange situation - when I'm trying to update model, that can contains
I have this situation: <root> //first block other tags <data>something</data> //first <data>something</data> <data>something</data> ...others
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following situation. A main table and many other tables linked together with

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.