问题描述
使用 VS 2019 的开发人员命令提示符
我可以看到我所有工作区的列表.
I am able to see a list of all my workspaces.
tf 工作区/collection:"https://dev.azure.com/[ORGANIZATION]"/owner:*
然后我可以使用以下方法删除我的本地工作区:
I can then delete my local workspaces using:
tf workspace/delete [WORKSPACE];"[OWNER]"
如果我启动 Visual Studio 然后重新运行第一个命令工作区返回.
If I launch Visual Studio and then rerun first command the workspace returns.
如果我从 VS UI 中删除工作区,也会发生同样的事情.只要我点击 map & 它就会重新出现get
创建一个刚删除的同名的新工作区.
The same thing occurs if I delete the workspace from the VS UI. It will reappear as soon as I click map & get
to create a new workspace of same name just deleted.
注意事项
在重新启动 Visual Studio 之前,我还尝试过:
Prior to relaunching Visual Studio I also tried:
- 在此处清除缓存文件夹:
C:Users[NAME]AppDataLocalMicrosoftTeam Foundation8.0Cache
- 在此处删除我所有的本地工作区文件:
C:Users[NAME]sourceWorkspaces
编辑
经过一些测试,我认为问题可能与同名的旧工作区有关.我无法删除旧的工作区,因为当我尝试删除旧的非本地数据库时,我收到:
After some testing I believe the issue may relate to an old workspace that had the same name. I cannot delete the old workspace because when I try to delete old non local databases I receive:
错误:
工作区 [WORKSPACE];[OWNER] 不存在.
我现在相信旧工作区是我从旧 TFS 迁移到 Azure 时的痕迹.
I now believe the old workspace is a trace from when I migrated to Azure from old TFS.
问题
- 如何删除所有工作区?
- 是否可以从 Azure Dev Ops 门户中删除工作区?
- 如何删除非本地工作区?
推荐答案
要删除现有工作区,您必须是所有者或将全局管理工作区权限设置为允许.
To delete an existing workspace, you must be the owner or have the global Administer workspaces permission set to Allow.
您也可以尝试使用 onwer uniq ID 而不是 name
You could also try to use onwer uniq ID instead of name
tf vc workspaces ws_3_3 /computer:* /format:xml /collection:https://dev.azure.com/patricklu/
ws_3_3
是您要删除的工作区名称,集合只需输入您的集合 url在提示窗口中输入您的地址以连接到 url(如果有).
ws_3_3
is your workspace name which want to delete, collection just type your collection urlIn the prompt up window type your address to connect to the url(If there is).
之后它会返回一些信息,如下所示:
After this it will return some information such as below:
带有所有者唯一 ID
然后你只需要使用 tf workspace/delete 命令,在我的示例中它使用:
Then you just need to use tf workspace /delete the command, in my sample it’s using:
tf workspace /delete ws_3_3;fb46f066-9122-4342-94c4-93b7526a3545
只需输入 yes,它就会删除工作区.无法确定源控制服务器" 这可能是由于您在尝试删除非本地工作区时未包含集合 url 造成的.
Simply type yes, it will delete the workspace. "Unable to determine the source control server" This may caused by you didn't include the collection url when you try to delete a workspace not locally.
1.如何删除所有工作区?
公司里没有删除所有工作区的命令,你必须一个一个地做.
There is not a command to delete all workspaces in company, you have to do it one by one.
2.是否可以从 Azure Dev Ops 门户中删除工作区?
不,你不能这样做.您应该使用命令行或通过 Visual Studio UI如下:
No, you couldn't do this. You should either use command line or through Visual Studio UIas below:
希望这可以帮助.
这篇关于Azure Devops - 删除工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!