【问题标题】:Push to local Azure DevOps Git from Release Pipeline从发布管道推送到本地 Azure DevOps Git
【发布时间】:2020-07-11 17:55:35
【问题描述】:

我们在几个 Azure DevOps 存储库中分发了一些脚本。 我们的目标是:

  1. 解析所有这些存储库
  2. 从我们的脚本中提取帮助信息并生成 .md 文件
  3. 将这些 .md 文件推送到另一个本地 Azure DevOps 存储库

我们正在使用发布管道,我们的源代码库作为工件。

我们如何验证这个本地仓库然后推送提交? 我收到以下错误:

2020-03-31T07:35:31.9598572Z ##[error]*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

是否可以使用代理身份或类似的东西?

【问题讨论】:

  • 好几天没有收到您的回复,能否分享一下您对此问题的最新信息?如果您有任何疑虑,请随时在此处分享。

标签: git azure-devops pipeline release


【解决方案1】:

您只需要在推送之前提供用户名和电子邮件:

git config user.email "some-email" 
git config user.name "some-username"

【讨论】:

  • 即使使用此配置,在推送到远程分支时出现以下错误:[error]fatal: unable to access 'https://test@dev.azure.com/test/project/_git/repos/': Failed to connect to dev.azure.com port 443: Connection refused
  • 您遇到的第一个错误是提供了稍后在提交日志中使用的用户名和电子邮件,因此无论如何您都需要它。 443?你使用代理吗?防火墙出站设置?
【解决方案2】:

对于这个问题,在 git push 步骤中,您可以尝试在推送 url 中提供您的 PAT,如下例所示:git push https://{AzureDevopsPAT}@dev.azure.com/{org}/{pro}/_git/xxx.git

要获取该令牌,您需要转到安全选项卡以生成个人访问令牌,以便我们可以将代码推送到 Azure DevOps 存储库。我们需要在Code部分选择Read,write & manage,这样我们才能有权限推送代码。

通过这种方式,我们可以解决以下错误:

【讨论】:

    猜你喜欢
    • 2019-09-19
    • 2019-02-21
    • 2021-07-22
    • 1970-01-01
    • 2021-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多