致命:无法读取“https://OrganizationName@dev.azure.com"的密码:终端提示已禁用 [英] Fatal: Could not read password for 'https://OrganizationName@dev.azure.com': terminal prompts disabled

查看:32
本文介绍了致命:无法读取“https://OrganizationName@dev.azure.com"的密码:终端提示已禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Azure Pipelines PowerShell 任务构建时,我正在尝试将 develop 分支合并到 master 分支.

但是在执行命令 git push 时,我收到此错误:

<块引用>

致命:无法读取密码'

在 git push 中使用 System.AccessToken:

git push https://$env:SYSTEM_ACCESSTOKEN@dev.azure.com/......

并授予构建用户推送权限(在 repo 设置中):

I'm trying to merge the develop branch to the master branch when building with Azure Pipelines PowerShell task.

But while executing the command git push, I'm getting this error:

Fatal: Could not read password for 'https://OrganizationName@dev.azure.com': terminal prompts disabled

The code repository is "Azure Repos Git".

git checkout -b master
git config --global user.email "xxxxxxx@xxxx.xxx"
git config --global user.name "xxxxx"
git merge origin/develop 
git push origin master

After referring some URLs, I've created the Personal Access Token, and modified the push command as git push https://PAT@dev.azure.com/OrganizationName, but it's still not working.

Please let me know, if you find a solution for this issue.

解决方案

As you mentioned you need to use PAT but in this way:

git push https://{PAT}@dev.azure.com/{organization}/{project}/_git/{repo-name}


Another solution is to "Allow scripts to access the OAuth token" in the job options:

In the git push use the System.AccessToken:

git push https://$env:SYSTEM_ACCESSTOKEN@dev.azure.com/......

And give push permissions to the build user (in the repo settings):

这篇关于致命:无法读取“https://OrganizationName@dev.azure.com"的密码:终端提示已禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆