authentication - 我可以使用带有额外 header 的 git-tfs 吗?

我需要在 azure devops 中自动执行“git-tfs pull”命令。 我在 cmd 窗口中使用我的用户/密码执行此命令没有问题,但是当它在 Azure DevOps Build Agent 中运行时它没有完成,确定这是一个身份验证问题。

Git 命令可以随请求传递额外的 http header 。 Azure DevOps 构建代理使用它在获取文件时在 AUTHORIZATION: bearer-header 中传递 OAuth token 。

git-tfs pull 是否可以通过请求传递额外的 header ?

最佳答案

Is it possible that git-tfs pull can pass the extra headers with the request?

没有...

但是...我没有尝试过这个,我猜它不会起作用,因为设置 OAuth 凭证往往需要 TFVC 客户端对象模型中的不同对象类型,但这可能会起作用:

git config --local tfs-remote.default.username .
git config --local tfs-remote.default.password $(SYSTEM.ACCESSTOKEN)

这会将管道中的 OAuth token 设置为用于身份验证的密码。确保管道有权访问此特殊变量。

如果管道的 OAuth token 无法解决问题,您可以尝试使用个人访问 token 。

https://stackoverflow.com/questions/60868934/

相关文章:

react-native - 使用 Hermes 的 React native 应用程序崩溃并显示

reactjs - 将 Ant 设计表导出为 pdf 格式

python-3.x - 重复的日志 Flask - Google Cloud Logging

r - 为什么 clogit 和 bife 函数(均在 R 中)的结果不同?

git - 在 Synology NAS 上启用 Gitlab LFS

javascript - 如何访问 react-image-gallery 中的 slideToIn

python - WinError 10061 由于目标机器主动拒绝,无法建立连接

asp.net - SignalR 协商阶段发生 CORS 错误

python - 无需安装即可导入 Python 库

react-native - React Native Webview OnLoad 调用了两次