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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:59:41+00:00 2026-05-12T16:59:41+00:00

Say I have branch A in TFS from which I take branch B. Some

  • 0

Say I have branch A in TFS from which I take branch B. Some changesets are made on B, then from B, branch C is taken, and more changes are made on branch C

A ------------------------------
     |
B    ----1--2------------------
                 |
C                ----3-----4---

Now suppose we want to merge from C into A, but bypassing B. TFS won’t allow this – I have to do a baseless merge, which can be very error prone. Really, I want to get C “reparented” (if that is the correct terminology) so it is a child of A, not B. In other words, I want to end up with the following branch structure. (C’ can either be the original C branch, or a new branch that is what C should have been).

A ------------------------------
     |   |
B    |   ----1--2------------------
     |           
C'   |-------1--2----3-----4---

Now C’ can be merged correctly into A without going into B.

My question is, is there any automated tool / script that could set up the pending changes required to create the C’ branch, as to manually do this would take us a very long time?

  • 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-12T16:59:41+00:00Added an answer on May 12, 2026 at 4:59 pm

    Reparenting a branch in TFS is hard. You can effectively give it an additional parent via baseless merge, but:

    • baseless merges are tedious & error prone, as you know
    • there is no command or API for removiong the merge relationship with the “real” parent, short of Destroy
    • you will not be able to perform merges in the new direction via the VS 2005/2008 Merge Wizard

    What you seem to be asking for — and I agree is the best solution — is a brand new branch named C’ that happens to have the same contents that C does today. Here’s a quick way to achieve that:

    1. Use the normal Branch dialog to create the new branch. If it must have the same name as C, that’s ok, just rename C to C_old first. You’ll need to decide whether it’s appropriate to branch from Latest or from some older version of A. (If it helps, you can see the version that B was branched from in the Properties dialog.)
    2. Delete the new C directory from disk.
    3. Navigate a command prompt to the C_old directory, then run tfpt scorch -diff -deletes. This will ensure C_old is up to date and does not contain any extraneous files (e.g. build artifacts).
    4. Copy C_old -> C.
    5. Navigate to C, then run tfpt online -adds -deletes -diffs . -r. This will pend adds, edits, & deletes as necessary for the server to record the delta between A [as branched] and C [as represented on disk].
    6. Checkin

    The only disadvantage of this method is that you won’t see changes 3 & 4 in the history. They’ll still be under C_old, of course, but tools like Annotate won’t know that — they’ll see those changes as occurring all at once, on the date you created C’, without the individual comments/work items/etc.

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

Sidebar

Related Questions

Say I have a feature branch, into which I merge upstream changes prior to
Let's say I have cloned repository, created new branch Topic1, made changes, commited them
Let's say I have a develop branch. I create a feature branch from this
I have branch say experiment and it was pushed a few days back. Now,
Say I have a branch A, and from that I branch B. I make
Say I have an arbitrary local git working directory that was cloned from some
I have two branches from trunk in TFS that say Dev and Release. Right
Let's say that I have a named branch 'B1' which I'm doing feature development
i have a table named record which contains four column branch,account,name,month. now i want
In svn, I have a branch which was created, say at revision 22334. Commits

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.