VFS for git tasks
VFS for git is an open source system that allow you to work with huge git repositories. It was created by Microsoft to support the code base for Windows which is roughly 300 GB big and contains about 3.5 million files. See Git at scale and gvfs.io for more information. The sources for VFS for git can be found on github.
This extension brings VFS for git to your build and release. By default VFS for git is not yet supported in the VSTS Get Sources task. But if you have large git repositories you need to work with and you do not need to download the entire repository on the build server this extensions will help you do just that!
The following articles give some more background on why and when VFS for git is usefull:
Minimum supported environments
Quick steps to get started
When using VFS for git on an agent there are basically 3 steps you need to take:
- Before you clone, make sure the target directory is empty
- Clone using gvfs.exe. This will automatically mount VFS for git enlistment.
- As the last step unmount the VFS for git enlistment using gvfs.exe(release the files).

Setup your build
- Make sure VFS for git is installed on your agent (download) 
- Create a new build 
- Disable build directory cleaning
 
 
- Disable source syncing in the - Get Sourcestask 
 
- Add the - Delete Filestask and configure it to clean the- $(Build.SourcesDirectory)(assuming you will clone your VFS for git repository into this directory). 
 
- Add the - VFS for gittask to your build and configure it to use the- Clonecommand.
 - 
- Select the Clonecommand
- Select the project
- Select the repository
- Select the directory where the repository must be cloned to. (default: $(Build.SourcesDirectory))
- Provide a VSTS variable name where the path to the repository will be stored (default: Vfs.Git.RepositoryPath).
 
 7. Add any other build steps you need. Note that the root of your repository is in a special
7. Add any other build steps you need. Note that the root of your repository is in a special src subfolder. So use the output variable set in the previous step to access your sources. The output variable, Vfs.Git.RepositoryPath by default, will contain the path to this special src folder.
 8. Add the
8. Add the VFS for git as on of the lasts tasks to your build and configure it to use the Unmount command. Make sure you do not need the contents of the repository after this step. Make sure you configure this taks to run always even if the build was canceled to ensure the VFS for git enlistments are properly unmounted.

Known issue(s)
Learn More
The source to this extension is available. Feel free to take, fork, and extend.
Feedback
- Add a review below.
- Create an issue here
- Submit a Pull request here