17

I know this has been asked before, but as there were no answers, I'm asking again.

I'm trying to migrate a shelveset from one branch to another. I'm running the following command, from within the workspace DIR:

tfpt unshelve changes;myusername /migrate /source:$/main /target:$/new-branch

when i run that command I get the 'shelveset details' window up, with the changes, and the folder (pointing to $/Main)

Clicking unshelve gives me the conflicts dialog box, again with folder pointing to $/main. If I click resolve, i get the following options:

  • Keep my local changes Undo my local changes, and take the shelved
  • Undo my local changes, and take the shelved changes.
  • Keep my local changes, and merge the local and shelved contents

which ever option I pick, I never get any pending changes in 'new-branch'. The only changes I have pending are for the main branch.

any ideas?

Jay
  • 2,077
  • 5
  • 24
  • 39

3 Answers3

8

You need to run this command from a directory that is mapped to your target branch ($/new-branch, in your example).

For example if your current branch is => Main which is mapped in your workspace at C:\Workspace\TeamProject\Main\...

And you want to move the changes to Dev which is mapped at D:\Workspace\TeamProject\Dev

Then you need to run the following command, from the following directory:

C:\Workspace\TeamProject\Main> tfpt unshelve "changes;muusername" /migrate /source:$/TeamProject/Main /target:$/TeamProject/Dev

See Tarun's blog post for more details: http://geekswithblogs.net/TarunArora/archive/2011/06/06/unshelve-shelveset-created-from-one-branch-to-another.aspx

Brian Gianforcaro
  • 26,564
  • 11
  • 58
  • 77
granth
  • 8,919
  • 1
  • 43
  • 60
  • 1
    FWIW, this was not a limitation for me. For me, I was able to run it from the parent directory of both branches. So, in the example above, it would've been `C:\Workspace\TeamProject\`. I wonder if the requirement is that you run it from a directory that is mapped as part of the workspace w.r.t. the branches in question. – JoeBrockhaus Oct 17 '14 at 18:10
  • 17
    @Grant Holliday: So... you say to run from a directory mapped to "target"... but you actually show that you run it from "C:\Workspace\TeamProject\Main"... which is "source"... very confusing answer! – scrat.squirrel Oct 30 '14 at 19:12
  • Is it possible to specify a default action to be performed when a conflict is found, instead of specifying it manually for each conflict? I have more than 700 files and it's impossible to manually specify it in my case. –  Oct 23 '15 at 16:02
3

I also had this problem and none of the solutions posted seemed working.

It turned out it was user error and I was using backslashes rather than forward slashes in my /target parameter.

This was because I originally copied the Local Paths of the project rather than the TFS Paths and then replaced the root path with $ when I noticed my mistake - but I missed the change in slash direction - apparently this matters and will mean that your shelveset will unshelve at the source branch.

Belzuk
  • 842
  • 9
  • 12
  • I had an incorrect path (typo), this answer made me double check it to catch it. – lko Nov 09 '17 at 21:26
2

I had same experience as the questioner using TFPT - Team Foundation Power Tools 2013. I would run the command and get the message "Auto-merge was successful", thinking it was working, but see no changes to the files in the target branch.
My command was something like this:

C:\Users\dev\TFS_TEST\rel1.1>"C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\tfpt.exe" unshelve cbbss02;xyz@gmail.com /migrate /source:$/E Pluribus Unum/SourceCode/rel1.2 /target:$/E Pluribus Unum/SourceCode/rel1.1

As others have mentioned, I put quotes around the source and target path:

"C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\tfpt.exe" unshelve cbbss02;xyz@gmail.com /migrate /source:"$/E Pluribus Unum/SourceCode/rel1.2" /target:"$/E Pluribus Unum/SourceCode/rel1.1"

got it to actually propogate changes to the target branch. (I also made sure that Visual Stuido was closed)

T.S.
  • 18,195
  • 11
  • 58
  • 78
user1558782
  • 123
  • 7