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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:56:19+00:00 2026-06-06T11:56:19+00:00

In a few days, I must make one complex commit, I’ll try to explain

  • 0

In a few days, I must make one complex commit, I’ll try to explain in details:

We’re using GIT (after migrating from svn) and have 3 work branches:

  • trunk – branch for immediate changes/fixes, developer’s playground, etc
  • preproduction – branch, where all of the features for client testing goes
  • production – the name says it all, working branch of the product

So usually developers go such sequence:

new ticket -> local copy -> trunk -> preproduction -> production

pretty standard, I guess.

Now, to the question itself:
In the trunk we have one completed hell of a task (1000+ hours), that was there before the migration from svn, so it’s not git-branched, or anything like that, it’s just a bunch of commits. We need to merge that task onto preproduction and then production branches accordingly.

I can’t quite sure what will be the most painless way of doing it. I’m not even sure branches have common ancestor commit after migration.

Is there a common way that problem could be solved? Maybe I can group commits, related to this task into branch followed by merging this branch with the pre and production?

Any advices greatly appreciated.

  • 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-06T11:56:21+00:00Added an answer on June 6, 2026 at 11:56 am

    If you need an ancestor commit (always a good idea IMO), you can use SVN to find the actual divergence point where trunk and preproduction/production were last the same, then find the SHA1 of the corresponding commit on the preproduction branch in git and do this:

    git checkout -b temp trunk // Don't use trunk itself in case it breaks
    git rebase <SHA1 goes here> // Rewrite the commits as changes from that SHA1
    // Possibly fix some conflicts
    // Verify manually that you have the code you expect
    git branch -m trunk old_trunk // Move old trunk aside
    git branch -m temp trunk // Here's the new trunk!
    

    Which will leave you with trunk branching off preproduction. You may with to repeat so that preproduction branches off production too.

    In order to merge them cleanly, turn on git rerere (so that the way you resolve any conflicts is recorded and automatically reused when you merge pre-production into production) and then do:

    git checkout preproduction
    git merge --no-ff trunk
    

    This will make a merge commit (no-fast-forward) so you can see where the feature starts and stops, rather than one long line of commits. It will also leave the trunk branch as it was, so you can keep committing to it ready to merge the next feature.

    The model we use to manage this process is git-flow, which sounds a lot like the workflow you are describing, so I’d recommend checking this out, along with the command line tools to support it.

    Also, if you wish to group the commits, I’d explore using rebase to take them out of the main flow of trunk and putting them back as no-fast-forward merges so you can see where particular feature start and end.

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

Sidebar

Related Questions

A few days ago I installed tomcat 7 and decided to try building a
Very complex query been trying to construct it for few days with more real
After a few days researching on hashing, generating random numbers or unique keys, I
I have been using Google CodePro Audit for java for few days now and
I'll release an app in a few days, but one thing I wonder is
I've been using Fiddler for a few days now, extending CustomRules.js with my own
this one has been puzzling me for a few days now and I feel
A few days ago I write a project in django1.4 using the admin capabilities
few days ago i asked about how to get all running processes in the
few days ago i read tutorial about GenericRepository and Unit Of Work patterns http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application

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.