用poweshell从TFS获取最新代码,并提交到SVN服务器上

本文介绍如何通过PowerShell脚本从TFS获取最新代码,并将其更新到SVN服务器。首先设置环境变量,然后分别获取TFS和SVN的最新代码。接着比较两个项目文件夹的差异,将TFS中的特定文件复制到SVN,并删除或添加SVN中缺失或新增的文件。最后,提交SVN的更改。
摘要由CSDN通过智能技术生成
#Enable powershell script.
Set-ExecutionPolicy RemoteSigned

#Add environment variables temperally.
$env:path+=";C:\Program Files\SlikSvn\bin";
$env:path+=";C:\Windows\System32";
$env:path+=";C:\WINDOWS\system32\windowspowershell\v1.0";

#Define the path of TFS project, SVN project and redirect temp file.
$tfsFolder="C:\project\tfs";
$svnFolder="C:\project\svn";
$tempFolder="C:\";

#Get the latest code forcely from TFS server.
tf get $tfsFolder /force /recursive;
#Update the code from SVN server.
svn update $svnFolder;
svn cleanup $svnFolder;
#Compare the two folders of TFS project and SVN project. Redirect the result to a temp .txt file.
tf folderdiff $tfsFolder $svnFolder /recursive /noprompt /view:targetonly > $tempFolder\targetonly.txt
tf folderdiff $tfsFolder $svnFolder /recursive /noprompt /view:sourceonly > $tempFolder\sourceonly.txt

#Copy the specific fil
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值