Certain operations require access to the remote repository from during a build. This task updates a remote of the Git repository on the agent to allow access to the upstream repository on Visual Studio Team Services.
For this build task to work it is required that the Allow Scripts to Access OAuth Token
option is set in the build definition options.
Remote name: Name of the remote which should be updated. Default is origin
.
Restore Git Remote should be called at the end of the build definition to restore the remote to its original value.
- Git-Lfs operations, like
git lfs fetch
still won't work with this. See this Git-Lfs issue