Download additional git repository from public repository or this TFS
This task will download git repository as an addition to default source. Consider this task as workaround where TFS build with git repository can only download 1 repository. Then this task will download another git repository required by your TFS build definition. This task assumes that git is already installed in PATH environment variable or %ProgramFiles%\Git within TFS build agent's machine.
URL of git repository. The repository should be public that can be downloaded without authentication. If it's the same location of main repository (specified in Get sources/first task of the build), then it's automatically uses the same credential.
Use $(Build.Repository.GitUri) to refer relative URI for git URL, examples:
Full path to store the git repository. If not specified, then it will be located in $(Build.GitDirectory)\[repo name].
Branch/tag to checkout. By default, it will download single branch/tag and will checkout to that branch/tag automatically.
If this is true, it will remove previously downloaded repository and use git clone command to download. Otherwise, it will stash everything and pull the remote branch/tag.
By default, this task expects public git repository that can be downloaded without authentication. But when the git repository is located in same TFS server, than it requires OAuth token for successful download. You can enable it in Options tab and check for Allow scripts to access OAuth token like screenshot below:
For YAML build, we need to expose the token to environment variable manually (named SYSTEM_ACCESSTOKEN) as follows: