前書き
Team Foundation Server(TFS)上に休職中の社員がチェックアウトしたままのファイルが残っていたため、
チェックアウトを外す方法を調べて実行した。その覚書き。
本題
- チェックアウト中のファイルを確認
コマンド
> tf status /collection:[検索対象コレクションへのURL] /user:[ユーザ名]
(例)
全ユーザについて確認する場合
> tf status /collection:https://hoge-server.net/tfs/hoge-collection /user:*
特定ユーザについて確認する場合
> tf status /collection:https://hoge-server.net/tfs/hoge-collection /user:hoge_user
- チェックアウトされたファイルのワークスペース名を確認
コマンド
> tf workspaces /collection:[検索対象コレクションへのURL] /owner:[ユーザ名]
(例)
> tf workspaces /collection:https://hoge-server.net/tfs/hoge-collection /owner:hoge_user
- チェックアウトされたファイルを元に戻す
コマンド
> tf undo /collection:[検索対象コレクションへのURL] /workspace:[ワークスペース名] [対象ファイルフルパス]
(例)
> tf undo /collection:https://hoge-server.net/tfs/hoge-collection /workspace:hoge_workspace $/hoge_folder/hoge_file.txt
よく分かるかもしれない解説
最終的に tf undo
コマンドを実行したいので、それに必要な情報を tf status
tf workspaces
で確認しています。