团队服务文档(https://www.visualstudio.com/en-us/docs/build/define/repository#what-kinds-of-submodules-can-i-check-out)指出我可以做一个$ git add submodule如果
他们举了一个例子:
git submodule add /../../submodule.git mymodule
Run Code Online (Sandbox Code Playgroud)
如果我在同一个项目中引用 git 存储库,例如
git submodule add ./../other-repo mymodule
Run Code Online (Sandbox Code Playgroud)
它解决了正确的回购协议,但希望我提供凭据。构建失败并显示以下消息:
Cloning into 'mymodule'...
fatal: could not read Username for 'https://xxx.visualstudio.com': Invalid argument
Run Code Online (Sandbox Code Playgroud)
提供带有凭据的完整 URL ( https://user:password@xxx.visualstudio.com/.. ) 可以,但在我看来是一个糟糕的解决方案。
该文档建议这应该适用于相对 url 并且无需凭据。我错了吗?
使用 system.debug 运行: true
Entering OnPrepareEnvironment
Primary repository: xxx
Calculating build folder hash key.
Loading tracking config if exists: C:\a\SourceRootMapping\07a8b96d-d805-4646-83d3-e7b2fbe394c2\18\SourceFolder.json
Creating new tracking config.
Loading top-level tracking config …Run Code Online (Sandbox Code Playgroud)