Showing posts with label TFS. Show all posts
Showing posts with label TFS. Show all posts

Wednesday, May 14, 2014

TFS switch working copy to another branch

Problem

I assume that you already have a working copy of $/branch1.
Let's say it's checked out to local folder c:\inetpub.
And you want to remap this working copy to $/branch2 without re-downloading everything again.

Solution

  1. First you'll need to unmap existing branch.
  2. Map working copy folder to new branch.
  3. Apply remap recursively.

Run the following commands from command line:

tf workfold /unmap $/branch1
tf workfold /map $/branch2 c:\inetpub
tf get c:\inetpub /remap /version:T /recursive


You'll probably want to unshelve a shelveset from another TFS branch afterwards.


Tuesday, February 18, 2014

How to change default code editor for shelveset details in TFS

You need to change the following key in windows registry:
1. open REGEDIT
2. Find the key HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command
3. Change the path to the editor (%ProgramFiles(x86)%\Notepad++\notepad++.exe  in my case)

How to unshelve changeset from one branch to another in TFS

You can do it using TFS Power Tools.

Here is the command:

tfpt unshelve "My Shelveset;DOMAIN\username" /migrate /source:$/project/branch /target:$/project/branch2

TFS Power Tools SCORCH

TFPT SCORCH - Ensure source control and the local disk are identical

Your local disk will be scanned for:
 (1) items that are not in source control
 (2) items which are different on disk from the workspace version
 (3) items which are in the workspace but are missing on disk

Items not in source control will be deleted from disk, just as with the
tfpt treeclean command. Items determined to be different on disk from the
workspace version will be redownloaded from the server. Items missing on
disk will also be redownloaded. Items with pending changes are exempted.

By default, items deleted from your local disk (#3 above) will not be
scanned for, and local items are determined to be identical/different from
the workspace version *solely by examining the read-only bit on the file*.

To redownload items deleted from your local disk (#3 above), supply the
/deletes option. To detect items which are different from the workspace
version but still have their read-only bit set (+R), supply the /diff option.
When using either or both of these options, tfpt scorch runs more slowly.

Usage: tfpt scorch [/exclude:filespec1,filespec2,...] [filespec...]
                   [/recursive] [/batchsize:num] [/noprompt [/preview]]
                   [/deletes] [/diff]

 /noprompt              Do not show the list of items to be deleted and
                        redownloaded in a dialog box for confirmation
 /exclude:filespec[,..] Files and directories matching a filespec in this list
                        are excluded from processing
 /preview               Do not make changes; only list the potential actions
 /recursive             Switch from one level of recursion to full recursion
 /deletes               Detect and replace items missing from the local disk
 /diff                  Use MD5 hashes to compare items with source control
 /batchsize:num         Set the batch size for server calls (default 500)
 filespec...            Only files and directories matching these filespecs
                        are processed (inclusion list)