TFS - undoing a checkout of another user ...

A common query we get is how we can undo a checkout for another user, either because the user has left the company, lost their machine and workspace or has simply gone on a vacation. In the following snapshot we can see that MTUNET/willyp has checked out the AssemblyInfo.cs file ... has gone on holiday and is therefore creating a bit of tension in the force. Microsoft reports the common scenarios as:

  • Undo a pending change because I need to check-in and someone has it exclusively checked out
  • Undo the checkout lock on the file and not the actual change itself
  • Undo all the changes in a workspace because the person has left the company or the group

imageCLIPART_OF_12412_SM

  • To list the workspaces for the doomed user, execute the following command:
    tf workspaces /owner:MTUNET/willyp /computer:*
    ... which gives us the following:
    image
  • To undo the checkouts on the AssemblyInfo.cs file you can run:
    tf undo /workspace:NEPTUNE_TEST;MTUNET/willyp "$/ATC_EcoSystem/ATF/ATF 1.1b 2003/Source Code/Automated Test Framework/Copy of ATFCoreAgent/AssemblyInfo.cs"
    ... which results in:
    image
  • Alternatively if the resource is gone for definite, you can delete the workspaces which will also undo any pending changes using the following command:
  • tf workspace /delete NEPTUNE_TEST;MTUNET/willyp /s:http://TFSTEST:8080
    and
    tf workspace /delete NEPTUNE;MTUNET/willyp /s:http://TFSTEST:8080
    image

If we look at the TFVC repository, we get the following updated view:
image

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值