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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:50:43+00:00 2026-05-27T11:50:43+00:00

Sequence: commit some code on trunk discover that it’s got a nasty problem. make

  • 0

Sequence:

  1. commit some code on trunk
  2. discover that it’s got a nasty problem.
  3. make a branch
  4. delete code on trunk (deleting entire files)
  5. fix code on branch

Now I want to bring the whole business back onto the trunk. A merge won’t do it, I think. What will?

  • 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-27T11:50:44+00:00Added an answer on May 27, 2026 at 11:50 am

    Assuming there’s no git-svn craziness here (I’m not sure if your use of the word “trunk” means you came from svn and kept terminology, or are actually interacting with it)…

    The cleanest way to do this, assuming your “delete code on trunk” triage step was done in an isolated commit, is to revert that commit, then merge:

    git checkout master
    git revert <triage-commit>     # could do this for multiple commits if needed
    git merge bugfix-branch
    

    If it’s not that clean, merging is the way to go; you’ll just have to handle some things. You might want to do it on a test branch just in case:

    # start back from master
    git checkout -b master-merge master
    # merge your fixes
    git merge bugfix-branch
    

    At this point, you should run into a lot of “deleted by us” conflicts (that’s how they’re reported by git status). This indicates that they were deleted on “our” branch (master) but modified on the to-be-merged branch. It will leave the versions from the to-be-merged branch in the tree. You can git add them to mark them as resolved. If you have conflicts that aren’t of this form, you’ll have to work through them as usual. Once you’ve fixed it all, inspect the results, test, and git commit to complete the merge.

    If you’re confident that all conflicts will result from this triage/bugfix scenario, then you could have used git merge -X theirs to tell Git to resolve all conflicts by keeping “their” version (the one from the bugfix branch). Only do this if you’re sure!

    git-svn note: I’ve heard that git-svn has issues with merges. I’ve never used it, I have no idea how it works, but if it’s the case that you’re not supposed to have merges in anything you intend to send back to the svn repo… then instead of merging above, you could rebase git rebase master bugfix-branch. You’ll run into exactly the same merge conflicts. Once you’ve dealt with them, you can fast-forward master up to the newly-transplanted branch with git checkout master; git merge bugfix-branch.

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

Sidebar

Related Questions

I try to checkout a remote branch. And then make a commit and then
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
I'm using a Sequence to generate an id for me, but I use that
Post Update: I have tracked down the problem at the command ExecuteNonQuery. That's the
I currently have a pre-commit hook in my mercurial project that gives the user
I'm trying to verify each commit in a sequence, moving from the first to
I'm customizing my bash prompt on OsX to include git branch plus some marks
Using Winsock2 the code sequence below returns -1 (failure) for select() . #include <Winsock2.h>
We know some escape sequence '\n' - new line but say we don't know
Let us have some sequence A, {-1, 3, 2, 5} for example. We can

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.