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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:37:21+00:00 2026-05-23T19:37:21+00:00

Context We use several git repositories with the same workflow, involving two branches, and

  • 0

Context

We use several git repositories with the same workflow, involving two branches, and are wondering how best to “synchronize” commits from one to the other.

Put simply, our git repositories contain:

  • Long living branches
  • Two branches:
    • master (branch for ongoing development)
    • 1.0 (branch for bugfixes only, to maintain a stable version)
  • Both branches are both regularly pushed to a public repo
  • Sometimes, ongoing development and bugfixes affect the same lines in the same files, so conflicts occur when merging/rebasing/etc.

We also have some less common conditions:

  • Unusual ratio: diffs of bugfixes (on 1.0 branch) are much bigger than those from ongoing development (on master branch).
  • Sometimes, commits from the 1.0 branch are cherry-picked to the master branch (“urgent” bugfixes needed both for stable releases and for development)

We could illustrate this as follows (commit 5' is a cherry-pick of commit 5 from the 1.0 branch):

-1--2-3--5'--7-- (master)
     \
      4--5---6-- (1.0)

Aim

Every so often, we need to make sure all bugfixes on the 1.0 branch are available on the master branch.

When doing this, our needs are:

  • The 1.0 branch must not be changed (no commits from master go to 1.0 branch)
  • Master needs to remain compatible with origin/master, so that we can push to a remote repo. This basically means avoiding rewriting master’s history (unless there’s a magic way to push this we don’t know about!)
  • We don’t want to lose the commit history: we need to be able to see whether a commit from the 1.0 branch has been applied to the master branch.
  • We’d rather not have to manually resolve conflicts arising from previous cherry-picks, I think git should be able to work this out by itself (as indicated in the man pages).
  • In the future, we’ll reach a similar situation again, and need to resolve it the same way, but don’t want to have to remember what resolutions to use for the commits 4 and 6 that we’ve already sorted out once.

So, an illustration of the situation we’re aiming for is:

-1--2-3--5'--7--4'--6'-- (master)
     \
      4--5---6-- (1.0)

What we’ve tried

  • Using a copy of the 1.0 branch, and rebasing it onto master:
    • Seems to work
    • But if we do the same operation again in the future, we have to review new commits AND old ones
  • Rebasing master onto the 1.0 branch
    • Works in a local repo
    • But can’t be pushed to remote, as this would be rewriting origin/master
  • Merging 1.0 branch into master
    • All conflict resolution ends up in ONE single commit, so the history doesn’t show the actual modifications previous commits required
    • Ideally, we would need a “git merge –interactive”, similar to “git rebase –interactive”: merge branches but interactively choose which commits to include or not, as we go

The question

It seems to us that this is probably a pretty typical use case for git, or for anyone maintaining and developing software in a public git repo, anyway.

How would you go about this?

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-05-23T19:37:22+00:00Added an answer on May 23, 2026 at 7:37 pm

    There are ups and downs to all the choices, and making an informed decision will rely heavily on reading everything you can possibly find. The biggest problem is that git wasn’t really designed from the ground up with any eye toward maintaining multiple “long term” branches, where you may need to maintain changes on a branch for years. So it’s likely you’ll eventually run into merge issues when code bases between branches have significantly changed.

    If you read most of the workflow documents, one of the biggest things your read repeatedly is: “apply patches to the bug fix branches and merge them upward”, never ever the other way around.

    Here’s what I came up with as the solution I’ve come up with for our Net-SNMP project. I wrote up a Git WorkFlow [in Net-SNMP] page that you might read, as it contains circles and arrows trying to explain how things work with lots of bug-fix branches.

    The downside to merging, though, is that the history becomes very non-linear. Which makes reading “git log”, no matter how many options you try and throw at it, sort of confusing.

    One of our developers kindly pointed out that we need to mandate the use of ‘git merge –log’, which at least helps the history a bit.

    Good luck!

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

Sidebar

Related Questions

I'have several forms that use the same Listboxes. The ListBoxes are populated from a
I several views in an iPhone app which happen to use independent openGL contexts.
Context: I use an ArrayCollection object as follows: 1) Number of elements is fixed.
the context i use Spooler Events API to capture events generated by the spooler
I want to use Context.Items to store some info of a User Control like:
I choose an item in my list to edit (I use Context Menu) ,
When a user request comes in, I can use Context.Request.UserHostAddress to get the user's
I'm having trouble understanding why I would use a context.xml file to declare a
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
Does excess use of AJAX affects performance? In context of big size web-applications, how

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.