1. Разблокирование файлов (unlock)
Разработчик по какой-то причине не делает (или не може сделать) check out, а файлы нужны для работы.
С помощью VS
В Sources Control кликаем правой мышкой на папке где находяться заблокированные файл и выбираем «Find in Source Control» — «Status»
Выполняем поиск. В получившемся списке кликаем правой мышью на нужный файл и выбираем «Undo».
C помощью коммандной строки
Сначала получить список рабочих пространств конкретного пользователя
tf workspaces /owner:DOMAIN\TheirUserAccount /computer:*
tf workspaces /owner:zinchenko /computer:*
Разблокирование
tf undo /workspace:TheirWorkspace;DOMAIN\TheirUserAccount $/path/to/file
tf undo /workspace:zinchenko;zinchenko $/BTI/Web/menu_style.css
Удаление рабочих пространств (если это нужно, например пользователя больше нет)
tf workspace /delete TheirWorkspace;DOMAINTheirUserAccount /s:http://TFSSERVER:8080
tf workspace /delete zinchenko;zinchenko /s:http://mytfs.ru:8080
tf.exe может ругнуться
Unable to determine the source control server.
В этом случае нужно переместиться в замепленную в TFS, например где лежит разблокируемый файл. И запустить tf.exe оттуда.
cd D:\SOURCES
"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe" /owner:zinchenko /computer:*
2. Удаление WI
tfpt destroywi /server:mytfs.ru /workitemid:783,777
witadmin destroy wi /collection:http://mytfs:8080 /id:28602
2a. Удаление типа WI
c:\MyProgram\Microsoft Visual Studio 10.0\Common7\IDE\witadmin destroywitd /collection:http://mytfs.ru:8080 /p:uspd /n:ЗТП
3. Откат изменений
D:\"C:Program Files\Microsoft Team Foundation Server 2008 Power Tools\tfpt.exe" uu /changeset:13961 $EGRPSOURCESVER_2007_2RP_RTUSERCSE.fmb
4. Перемещение файла (move).
В TFS это делается командой rename.
Запускать команду нужно из локальной папки куда замаплен файл
cd D:\SOURCES
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe" rename D:\SOURCES\ADM\test.fmx D:\SOURCES\test.fmx
Файл для облегчения задачи
===================== tfs_group_move.cmd ===============================</p> <p>@echo on<br> del c:\templisting.lst<br> for %%i in (D:\SOURCES\*.*) do echo "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe" rename D:\SOURCES\%%~ni%%~xi D:\SOURCES_NEW\%%~ni%%~xi >> c:\templisting.lst</p> <p>===================== tfs_group_move.cmd ===============================
5. Удаление проекта
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TFSDeleteProject.exe /server:mytfs.ru xxx
(выполнять два раза, т.к. первый раз падает с ошибкой или с опцией /force).
6. Проверить доступ в TFS можно зайдя под пользователем на ссылку
http://tfs_server:8080/services/v1.0/serverstatus.asmx
7. Очистка локального кеша Team Explorer
devenv.exe /resetuserdata
добавочно лучше еще и руками потереть
C:\Documents and Settings\Local Settings\Application Data\Microsoft\Team Foundation\2.0
%USERPROFILE%\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache
8. Удаление учетки, чтобы зайти под другим пользователем
In Visual Studio SDK there is a Visual Studio Team System Integration part which in the subfolder named «Utilities» hides three useful utilities. One of these utilities called «CleanCreds.exe» should do the trick. Here is a part of the readme.txt file for the utility:
CleanCreds.exe
—————
This tool is used to delete stored credentials for Team Foundation Server connections. It applies to the following scenario:
1. From the Team Explorer, connect to a Team Foundation Server for which the running account does not have permissions.
2. When prompted for alternate credentials, enter in alternate login and password and check the «Remember my password» checkbox
3. Confirm the alternate credentials and login to the server
4. Any future connection to that Team Foundation Server from this machine using the running account will use the alternate credentials. There is no easy way to delete the stored alternate credentials.
This scenario is problematic in environments where the Team Explorer client machine is shared and alternate credentials are used frequently.
Clearing Credentials
———————
To delete the stored credentials, use the CleanCreds.exe utility as follows.
1. Ensure that you have logged in to the client machine using the original running account
2. Copy the CleanCreds.exe to the client machine
3. From the command prompt, run:
CleanCreds <Team Foundation Server URL>
The URL usually looks as follows:
http://TFS:8080
This will delete the alternate credentials stored for the running account for connecting to the specified Team Foundation Server.
9. Удалить WI из базы насовсем
DECLARE @ID INT<br> SET @ID = 570</p> <p>DELETE FROM [TfsWorkItemTracking].[dbo].[WorkItemLongTexts]<br> WHERE ID = @ID</p> <p>DELETE FROM [TfsWorkItemTracking].[dbo].[WorkItemsAre]<br> WHERE ID = @ID</p> <p>DELETE FROM [TfsWorkItemTracking].[dbo].[WorkItemsWere]<br> WHERE ID = @ID</p> <p>DELETE FROM [TfsWorkItemTracking].[dbo].[WorkItemsLatest]<br> WHERE ID = @ID<br>
10. Обновить значение какого-нибудь поля для WI (для одного WI или для всех)
DECLARE @ID INT<br> SET @ID = 3287</p> <p>update [TfsWorkItemTracking].[dbo].[WorkItemsAre]<br> set Fld10001='-'<br> --WHERE ID = @ID</p> <p>update [TfsWorkItemTracking].[dbo].[WorkItemsWere]<br> set Fld10001='-'<br> --WHERE ID = @ID</p> <p>update [TfsWorkItemTracking].[dbo].[WorkItemsLatest]<br> set Fld10001='-'<br> --WHERE ID = @ID
11. Посмотреть название поля
SELECT *<br> FROM Fields<br> WHERE FldID = 10001
12. Найти поле
SELECT *<br> FROM Fields<br> --where name='AreaID'<br> order by name