在TFS源代码管理器中,我们需要对网站进行Branch备份,当管理的网站数目比较多时,如果手动去做备份,这会显得十分繁琐。因此可以自己写一个脚本,双击执行,或添加到windows计划任务中定时执行。
脚本:
@echo off echo ------------TFS branch bat,develop by terry------------- ::username password set username=tfs登陆登录名 set password=tfs登陆密码 ::Site Url Config set tempSource=$/Public Websites/Stage set tempTarget=$/Public Websites/Release ::Branch Config set newBranchName=20121106 set version=T set comment=20121106 code deployment set author=tfs登陆登录名 ::Open TFS IDE cd \Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE @echo Branch Start.. ::Public Websites,add site what you want to branch.It can be better below. tf branch "%tempSource%/Test Site 1" "%tempTarget%/Test Site 1/%newBranchName%" /checkin /comment:"%comment%-Branched from $/Public Websites/Stage/Test Site 1" /author:"%author%" /login:%username%,%password% tf branch "%tempSource%/Test Site 2" "%tempTarget%/Test Site 2/%newBranchName%" /checkin /comment:"%comment%-Branched from $/Public Websites/Stage/Test Site 2" /author:"%author%" /login:%username%,%password% @echo Branch End.. pause