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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:05:43+00:00 2026-06-17T01:05:43+00:00

We just switched from Subversion to Git. The problem that came up this morning

  • 0

We just switched from Subversion to Git.

The problem that came up this morning was that we cherry-picked a commit from a branch into master so maser would have a bug fix. Then we merged master back to the branch.

When we tried to compile, all of the additions from the cherry-picked commit were in the code twice.

The cherry-picked commit consisted of the addition of a couple of lines of code, which ended up afterward being in the code twice. Luckily they were entire functions so it threw a compiler error.

There was never a conflict raised.

How do we avoid this. It’s a major problem.

Thanks.

  • 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-17T01:05:44+00:00Added an answer on June 17, 2026 at 1:05 am

    A cherry-pick is a different commit from Git’s point of view. i.e. when you merge back, you’re merging back a new commit on top of that originally applied.

    That is to say, you create a commit with hash ABC. You cherry-pick it across, creating a new commit DEF. The merge back then applies DEF alongside ABC.

    In the above, I would perhaps expect you to simply perform the commit on master (say) and cherry-pick that to your branch.

    This blog post has more info.

    Notice that it creates a new commit on the master branch. If, on
    master, you run “git log”, you’ll see a different hash for the same
    commit message. Why?

    This is because of how Git models what a commit is. A commit is a
    complete snapshot of the whole repository, and the hash for a given
    commit reflects the state of every file in the whole directory – it is
    a hash of all their hashes.

    So clearly, since master branch doesn’t have all of the commits from
    the feature branch, a complete snapshot of it at the time the bugfix
    is applied will generate a different hash than a complete snapshot of
    the feature branch at the time the bugfix is applied there. Thus,
    different hashes.

    But when you do merge the feature branch into master, that won’t
    matter; the hashes for the individual file where you made the bugfix
    will be the same, because their contents will be the same, so there
    will be nothing to update on master for that file.

    This blog post details a similar situation and how to use git rebase to avoid such issues.

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

Sidebar

Related Questions

I just switched from Subversion to Git. Subversion's centralized architecture gives it a meaningful
I just switched from Eclipse to IntelliJ and noticed that when I use Reformat
So I just switched from some network solutions hosting running some php files that
I just switched from XML mapping to annotations and had to realize that my
I just recently switched from EF5 to NHibernate due to a few features that
I just switched from XAMPP to MAMP and now this rewrite rule does not
I just switched from Textmate 2 to Sublime Text 2. I figured that typing
We just switched from ojdbc14 to ojdbc6, and noticed that when we insert a
I just switched to Moq and have run into a problem. I'm testing a
I just switched from C++ to Java. I'm trying to write a program that

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.