如何在TFS中用命令列提交更新

來源:互聯網
上載者:User

首先,我們建立一個通用的bat讓它來對某個檔案進行擷取、簽出、複製、簽出操作。

postbuild.bat

REM %1-來源目錄 %2-目標目錄 %3-檔案名稱
REM 在產生後事件中寫D:\projects\_CommonLibrary\postbuild.bat $(TargetDir) D:\projects\_CommonLibrary\XXX $(TargetFileName)
if defined TFPATH goto runtf
if defined ProgramFiles set TFPATH=%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE
if defined ProgramFiles(x86) set TFPATH=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\IDE
:runtf
@echo '更新開始'
"%TFPATH%\TF.exe" get %2\%3
"%TFPATH%\TF.exe" checkout %2\%3
copy %1\%3 %2\%3
"%TFPATH%\TF.exe" checkin %2\%3 /override:reason.txt /noprompt 
set TFPATH=
@echo '完成'

這個bat檔案可以用在項目的產生後事件中,這樣每次編譯就可以自動把產生的dll簽入到tfs中;同樣也可以寫一個外部的bat檔案使用這樣的功能。

例如還有一個copy.bat任務:

net use \\192.168.1.5 /user:使用者名稱 密碼

call D:\postbuild.bat D:\xxx\bin\Release D:\yyy\abc.dll

call D:\postbuild.bat D:\xxx\bin\Release D:\yyy\abc.pdb

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.