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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:21:58+00:00 2026-06-14T16:21:58+00:00

I’m having this strange problem with Git merging that I’m unable to explain or

  • 0

I’m having this strange problem with Git merging that I’m unable to explain or categorize. Is it a missing commit. Is it a merge gone wrong? Is it corrupted data? Here’s what the repository history looks like:

master----\----commit A----cherry-picked changesets from topic---commit B--\----commit C----merge---
           \                                                                \              /
            topic-----------------------------------------------------------merge---------/

Now, my problem is that when master is merged INTO the topic branch (to bring it up-to-date with commits A & B), the changeset introducted by commit B is just not there! If commit B was modifying files foo & bar, even got lot does not show those files being changed with the merge. There isn’t even any conflict in files foo and bar

Now when I merge topic back into master, commit B is in-effect reversed without ANY log or trace of the reversal!

What could’ve gone wrong?

  • 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-14T16:22:00+00:00Added an answer on June 14, 2026 at 4:22 pm
    master----\----commit A----cherry-picked changesets from topic---commit B--\----commit C----merge---
               \                                                                \              /
                topic-----------------------------------------------------------merge---------/
                                                                                ~~~~~
                                                                                  ^
                                                                                  + here you merged B in topic
    

    There is a merge already in topic that has commit B as parent. So B is fully merged in topic and won’t be merged anywhere anymore.

    Since you don’t have the changes in topic, you apparently reverted them on topic, either in the merge itself or in a following commit. Such reversal is a regular commit for the merge algorithm and it’s not merged into master. So when you merge topic into master, this commit’s changes will be merged, reverting commit B.

    To get the changes from B back, you have to either:

    • Find and revert the reversal of B’s changes on topic.
    • Cherry-pick B (git cherry-pick B) on topic.
    • Redo the merge, rebase topic after the merge on the new merge and forget the original branch, but as that involves rewinding you can only do that if you control all repositories that have the branch.

    How the changes might have been reversed without you realizing it? If you are merging and get conflicts, you might resolve them sloppily using “local” thinking that you don’t need these changes there yet. But from Git’s (or any other version control system’s for that matter; 3-way merge works the same in all of them) point of view you’ve seen the changes and rejected them, so you won’t get them again, ever, unless you manually re-apply them.

    The conflict might have easily been caused by the earlier cherry-picks. While the algorithm won’t declare conflict if both sides look the same and thus if you cherry-pick and than merge, it will declare conflict if you modify the cherry-picked code on one side. Say you have:

    ----\-- A -------- B' -- B2 --\
         \                         \
          D -- B -- E -----------merge
    

    where B' picks B and B2 modifies the same code that B did. In that case the merge will see that one side did B and the other side did B2, because the cherry-pick is hidden by B2 and will thus declare conflict between B and B2. And if you don’t carefuly look at the history, you may easily resolve this wrong. You can avoid the problem if when picking a commit you carefuly merge the target branch into the source one like this:

    ----\-- A --------\- B' -\- B2 --\
         \             \      \       \
          D -- B -- E --m1-----m2----merge
    

    where m1 is normal merge with no cherry-pick involved and m2 is resolved with local version, because it only has the cherry-picked changes on remote. That will ensure further merges will work correctly.

    It should actually be possible to write a merge strategy for git to do this automatically.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I know there's a lot of other questions out there that deal with this
I have been unable to fix a problem with Java Unicode and encoding. The
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I

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.