tf.exe history . /r직접 사용하는 일반적인 대답 은 작동하지만 매우 느릴 수 있습니다. 우리의 경우에는 10-15 초가 걸립니다. 이제 2 단계 검사를 사용하여 먼저 일부 임의 파일의 개정을 확인합니다 (루트 폴더에있는 파일을 사용하고 있습니다).
powershell 사용 :
$tfexepath = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe"
$localpath = "C:\some\tfs\directory"
$result = & $tfexepath history $localpath /noprompt /stopafter:1 /version:W
"$result" -match "\d+" | out-null
$id = $matches[0]
그런 다음 / r 플래그를 사용하여 루트 에서 검색 하지만 위에서 찾은 개정판에서 시작 하도록 검색 을 제한합니다 .
$result2 = & $tfexepath history $localpath /r /noprompt /stopafter:1 /version:$id~W
"$result2" -match "\d+" | out-null
$id2 = $matches[0]
#result:
Write-Host $id2
코드베이스의 경우 총 시간이 10-15 초에서 1.4-1.5 초로 단축됩니다.
내가 이해하는 한 단점이나 한계는 없지만 작은 저장소에서는 더 느릴 수 있다고 생각합니다. -알았 으면 좋겠어요.