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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:13:40+00:00 2026-06-05T15:13:40+00:00

I’m using git in a project with multiple branches used concurrently, that is: A

  • 0

I’m using git in a project with multiple branches used concurrently, that is:

A ---- B ---- C
 \       \
  \       ---- D
   ---- E

Every named item is used depending on the situation (i.e. I need to have access to both A, B and D…). When I modify the code, I do it in the higher relevant branch I can (mostly A), and then I rebase every branches to the new “A” to propagate differences.

Since I was told that it was a bad habit since it creates problem with push/pull, and now I have to add a new maintainer to my project, I’d like to have another way of doing what I want.

I was proposed to do conditionnal compilation, and it was the way I proceeded in the early development, but now I have many branches (~10 at the moment) and the code became very hard to read, that’s why I came to this branching solution…

Cherry-picking looks great, but it makes 10 commits for each commit, and we lose the “visual” representation of the fact that B is a child of A…

Any other idea, suggestion?
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-05T15:13:40+00:00Added an answer on June 5, 2026 at 3:13 pm

    Just use ‘git merge’ instead of ‘git rebase’.

    Suppose a bug appeared in branch A in your graph. It is the most upstream branch that shows the bug, therefore that’s what you fix. You check it out, code the fix, test the fix, and confirm it works on A. Then, when you want to propagate it everywhere else, you:

    1. Checkout B and merge A into B.
    2. Checkout E and merge A into E.
    3. Checkout C and merge B into C.
    4. Checkout D and merge B into D.

    If the problem first showed up in B, you’d checkout B, code the fix, test the fix, and then do just steps 3 and 4.

    Search for “merge upwards” on this page for more information.

    This does result in many merge operations, 10 in your example if you fix A, the parent branch of 10 descendent branches, but it’s also the sanest workflow you can use that won’t a) drive your collaborators nuts because rebased commits keep getting pushed to the remote, and b) won’t completely destroy your ability to merge the branches into one another.

    b) by the way is why you don’t want ‘git cherry-pick’ for this. Cherry-pick will propagate your change set from A to 10 other branches, sure, but it’ll change that commit’s SHA1 hash in every distinct branch it’s used. Were you to merge B into A at some later date, for example, you’d end up with redundant history: change sets that are identical in what they do, but with completely different SHA1 hashes. This isn’t a terribly big deal on occasion, but if you codify it into your workflow, it will fail you in miserable ways. Redundant merge history also ruins ‘git bisect’ and ‘git rebase’, and is nearly impossible to read. Avoid ‘git cherry-pick’ when you can for this branching model.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.