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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:36:32+00:00 2026-06-11T20:36:32+00:00

I am assigned to two projects, both of which are derived from a common

  • 0

I am assigned to two projects, both of which are derived from a common parent and targeted to be merged back to the parent around the same time.
To make it simple, let’s call them master, projA and projB.

Let’s say the folder structure of the source code is:
/src/main/UI
/src/main/backend

Let’s say there is a file and we want to add a new common error handler inside of it.
This function should be shared between projA and projB.
/src/main/backend/common/errorhandler.cpp

The branching is as follows (both branched from master and ultimately merged back to master.
aN/bN are project specific changes.
AN/BN are changes errorhandler.cpp

       -- projA--a1-a2--A1--
      /                     \
------                       master
      \                     /
       -- projB--b1-b2--B1--

So at some point there may be changes in projA that are needed in projB, so the commits would look like this (say after cherry-picking A1 into projB).

       -- projA--a1-a2--A1--a3---
      /                          \
------                            master -- projA' -- projB'
      \                          /
       -- projB--b1-b2--B1--A1'--

From what I read, I cannot merge just A1 into projB. It would merge a1, a2, and A1.

I could use cherry-pick, which would then be A1′ in projB, at the expense having A1` and A1 being treated as separate changes when both projA and projB are merged back to master.

I was hoping someone might have a better plan where I could still use merge so that I do not end up with ‘duplicate’ changes.

  • 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-11T20:36:32+00:00Added an answer on June 11, 2026 at 8:36 pm

    EDIT:

    First (just to make sure), your /src/main/backend/common/ should be implemented in the master branch (and maybe edited in any branch).

    Then you create your branches projA and projB from master. You work on projA branch on the UI, and at the same time on the backend in projB branch. No problem so far.

    You have now A1, B1 commits in respective branches.

          ---projA -- a1 -- a2 -- A1 
         /                          
    ----------------------------- master
         \                          
          ---projB -- b1 -- b2 -- B1
    

    And what you want is only A1,B1 but not a1, a2, b1, b2. Indeed I recommend cherry-pick. One bad thing (among others) with cherry-pick is that the history is not nice afterwards. But in your case, I don’t see many (even any) other possibilities.

    When you are on master branch (to switch: git checkout master), you run git cherry-pick A1 (A1 being the commit SHA) and it will merge the UI commit ‘A1’ into master branch:

          ---projA -- a1 -- a2 -- A1    
         /                             
    ------------------------- master ---- A1'
         \                          
          ---projB -- b1 -- b2 -- B1
    

    and then, still on master branch, you merge the backend commit ‘B1’ by running git merge projB. The result is:

          ---projA -- a1 -- a2 -- A1    
         /                             
    ------------------------- master ---- A1' ---- B1'
         \                          
          ---projB -- b1 -- b2 -- B1
    

    And that should be it, your project on master branch now has the form you wanted. I’ll think a bit more about it to see if other things are possible.

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

Sidebar

Related Questions

We want the query result should be assigned with two results based on some
I am trying to evaluate two dynamically assigned variables; then attempting to assign a
We have two tables - Tasks and TasksUsers (users assigned to task). Task has
I have two datepickers. When start date is selected, end date is automatically assigned
I've written this piece of code where I've assigned an unsigned integer to two
I have assigned 5000 ms to Settimeout but it is executing before assigned time
Let's say I have two types of MongoDB documents: 'Projects' and 'Tasks'. A Project
I have a div with content and overflow assigned giving it two scroll bars.
I'm working on a employee booking application. I've got two different entities Projects and
I was assigned to an existing project which has a lot of DLL. 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.