I'm using a local TFS 2018 instance for a customer project in which he owns the source code. I want him to have complete access to this code in the event I become unexpectedly unavailable.
My proposal for this is to create a TFS release step that syncs my TFS origin
with a repo in his VSTS account.
I've been able to do this manually, from my workstation, using this approach:
cd /path/to/local/repo
git remote add tfs url://tfs/git/repo
git push --mirror tfs
But I'm prompted for his VSTS credentials, which obviously won't work in a TFS release step.
Also, I encounter this error when attempting to remote add
from the desktop of my TFS server:
D:\Agent\_work\37\s>git remote add Application https://customer.visualstudio.com/Applications/_git/Application
Rename from 'D:/Agent/_work/37/s/.git/config.lock' to 'D:/Agent/_work/37/s/.git/config' failed. Should I try again? (y/n)
I can add it at my workstation, although it doesn't show up as a change that can be committed for a push
to TFS. So it seems I'm unable to tell TFS about the remote VSTS repository.
How can I fully automate this task in a TFS release step?