Visual Studio 2017 Cannot Move Shelveset to Another Branch

后端 未结 7 789
刺人心
刺人心 2021-02-05 04:20

Since they have supposedly integrated most of the Power Tools functionality into VS2017, the new command \"tf unshelve\" does not work the same as the old command \"tfpt unshelv

相关标签:
7条回答
  • 2021-02-05 04:56

    Here's how I do it when I know the branch files can be overwritten directly by the shelf-set. If you need to merge, then use win-merge with directory compare to stitch things back together.

    • Close all instances of Visual Studio
    • Rename your local source directory to a temporary name
    • Open Visual Studio
    • Unshelve your changes normally - VS will recreate the directory structure with just your changes in it.
    • Copy all your changed files into your branch directory (overwrite read-only files)
    • Close visual studio
    • Rename your local source directory back to its original name (get rid of the one VS recreated)
    • Reopen your branch project
    • Two options now: you can go offline then back online again to let VS figure out what changed, or just check out your whole folder and then check in again. Just make sure you don't have anything else checked out before you do it!

    It's a shame that this hasn't been put into VS as a native feature yet, but when you consider the complexity of un-shelving into a code merge, and preserving history, etc, the task becomes complex. Good luck!

    0 讨论(0)
  • 2021-02-05 04:58

    Another WORKAROUND...

    1. Check in the changes from existing shelveset (Changeset 1)
    2. Merge the changes to the other branch and check in (Changeset 2)
    3. Rollback the changes from Changeset 1.

    This keeps changes from changeset 2 and rolls back the original branch.

    This process may not work for every company and their policies but it does work. I don't like it but sometimes it is necessary.

    0 讨论(0)
  • 2021-02-05 04:58

    Until now (Feb 2020) TSPT is not available in Visual Studio.

    The workaround i found is to create a new Branch and use a tool like WinMerge (http://winmerge.org) to compare and merge changes from Main to the new Branch then when it's all right undo the changes on the main branch.

    0 讨论(0)
  • 2021-02-05 05:14

    I absolutely agree this is a greatly missed feature in 2017 and up. After too many times of doing this manually, I decided to add it to my (free) Visual Studio Extension called 'MultiMerge'. You can now right-click a shelveset and choose your target branch. There's a VS2017 version and VS2019. Or you can simply choose this extension using Tools and Extentions menu in Visual Studio.

    Feel free to rate the extension, and let others find it more quickly:)

    0 讨论(0)
  • 2021-02-05 05:14

    Multimerge extension (MultiMerge.2017, MultiMerge.2019) worked like a charm for me. (Or rather to the extent that TFVC tools as such cannot merge by reapplying a patch.)

    No tfpt for VS 2017 and VS 2019. The unshelve /migrate command has not been incorporated into tf neither. So nothing that works out of the box as yet. (Last checked on v16.7.5)

    0 讨论(0)
  • 2021-02-05 05:16

    Unfortunately move Shelveset to Another Branch with the command "tftp unshelve" or "tf unshelve" is still not supported for now in VS 2017.

    There's already a feedback submitted here to track that, just as Youhana Naseim [MSFT] mentioned below (source here) :

    For VS 2017 we do not have a power tools release. We are constantly evaluating the features that are still missing in the product. The three most notable ones are:

    • TFS Windows Shell Extensions integration

    • Find by Status for server workspaces

    • Unshelve /migrate

    So as a workaround, you can try below ways:

    • Use tf unshelve and tf rename command to achieve this in two steps.
      1). c:\projects>tf unshelve 2). c:\projects>tf rename 314.c ..\newdir\1254.c
    • Copy shelved files manually to target folders and do compare against the server version as Alexander Nikonov mentioned here.
    • Install VS2015 and Microsoft Visual Studio Team Foundation Server 2015 Power Tools.
    0 讨论(0)
提交回复
热议问题