简体   繁体   English

使用Git构建过程的TFS

[英]TFS with Git Build process

Currently my office moving towards TFS and we are setting local TFS based git for every PHP projects we have/do. 目前,我的办公室正在向TFS迁移,我们正在为我们拥有/执行的每个PHP项目设置基于本地TFS的git。

Project setup in TFS with team using git branch/commit works as expected and we want to do the auto-publishing of one branch updates to ftp folder, that also works, 使用团队使用git branch / commit在TFS中进行的项目设置可以按预期工作,我们希望将一个分支更新自动发布到ftp文件夹,这也可以,

But every time it copies the entire list of files from TFS git code folder to remote server and i couldn't able to set it up correctly. 但是,每次它将整个文件列表从TFS git代码文件夹复制到远程服务器时,我都无法正确设置它。

My Copying process is like this in TFS 2017. 我的复制过程在TFS 2017中是这样的。

在此处输入图片说明

How can i set tfs build process so only changes from commits can be copied to remote server with tfs 我如何设置tfs构建过程,以便只能使用tfs将提交中的更改复制到远程服务器

Basically TFS always delivered all files (including changed and unchanged). 基本上,TFS始终交付所有文件(包括已更改和未更改的文件)。

For an incremental build (Set Clean to False when get sources in your case), it will sync the source and only get the changed files from the second time to build. 对于增量构建(在您的情况下,获取源时将Clean设置为False ),它将同步源,并且仅从第二次构建开始获取更改的文件。

So, if you want to deliver the only changed files to a specific location, you can add a Copy Files step to copy the changed files to the location. 因此,如果要仅将更改后的文件传递到特定位置,则可以添加“ 复制文件”步骤以将更改后的文件复制到该位置。 That means you need to modify the build definition every time, obviously it's not applied to CI (Continuous Integration). 这意味着您每次都需要修改构建定义,显然,它不应用于CI(连续集成)。

As a workaround you can write a script to delete the unchanged files from the staging folder before uploading to FTP location. 作为一种解决方法,您可以编写脚本以在上载到FTP位置之前从登台文件夹中删除未更改的文件。

Reference below similar threads: 下面引用类似的线程:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM