Migrating Shelvesets between branches in TFS

So, if you work on a branch-per-release cycle, sometimes things take longer than expected.
Here’s a quick way to move a shelveset from one branch to another:
tfpt unshelve - Unshelve into workspace with pending changes

Allows a shelveset to be unshelved into a workspace with pending changes.
Merges content between local and shelved changes. Allows migration of shelved
changes from one branch into another by rewriting server paths.

Usage: tfpt unshelve [shelvesetname[;username]] [/nobackup]
[/migrate /source:serverpath /target:serverpath]

shelvesetname The name of the shelveset to unshelve
/nobackup Skip the creation of a backup shelveset
/migrate Rewrite the server paths of the shelved items
(for example to unshelve into another branch)
/source:serverpath Source location for path rewrite (supply with /migrate)
/target:serverpath Target location for path rewrite (supply with /migrate)

Serverpath is $/Project/DirectoryStructure

Don’t use nobackup. Bad idea. Backups never hurt anybody. Also, you should run this from within a directory that you’ve got mapped (source directory works great), otherwise you might have an issue with TFPT not being able to figure out which workspace, even if there’s only one.

Tagged , ,

One thought on “Migrating Shelvesets between branches in TFS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: