Visual Studio 2017 Cannot Move Shelveset to Another Branch

后端 未结 7 799
刺人心
刺人心 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!

提交回复
热议问题