Update:
Now you should use below to avoid syncing sources at all:
Classic Editor: agent.source.skip=true
YAML:
steps:
- checkout: none
It’s not able to directly disable/remove the Get Sources task. However, you could add a variable to achieve it:
Build.SyncSources = false
You can see from below screenshot, the Get Sources operation started
and finished without fetching the data from TFS version control
Note: This variable works with TFS 2017 and above/VSTS vNext builds.
More detail info please take a look at this helpful blog.