0

Currently my office moving towards TFS and we are setting local TFS based git for every PHP projects we have/do.

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,

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.

My Copying process is like this in TFS 2017.

enter image description here

How can i set tfs build process so only changes from commits can be copied to remote server with tfs

Elamurugan
  • 3,204
  • 13
  • 59
  • 104

1 Answers1

1

Basically TFS always delivered all files (including changed and unchanged).

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.

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).

As a workaround you can write a script to delete the unchanged files from the staging folder before uploading to FTP location.

Reference below similar threads:

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • @Elamurugan Have you resolved the issue ? any update? – Andy Li-MSFT Feb 13 '18 at 14:42
  • am working to get only changed files to copy over ftp server but with original first task since its copying, all files am not able to identify how I can get only changed files into one directory in build step and copy it to ftp server. Can you please point me on a direction for this? – Elamurugan Feb 16 '18 at 03:15
  • @Elamurugan Have you checked the links I mentioned above? write a script to delete the unchanged files from the staging folder should be a workaround. Only identify the changes is difficult, unless you retrieve the specific changeset history, then get the changed files one by one. I think it's not worth a try. – Andy Li-MSFT Feb 16 '18 at 11:03