Azure Pipelines: I am getting fatal: could not read Username for 'https://github.com': terminal prompts disabled

前端 未结 4 1198
一向
一向 2021-01-02 08:02

I have powershell task configured in azure build pipelines to merge changes from dev into master of my github public repo and push changes to master. I am getting

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-02 08:05

    I don't why but when you try push after merge git want the username & password.

    Azure DevOps by default disable the prompt to enter the credentials and you got the error.

    You can enable the prompt by set the environment variable GIT_TERMINAL_PROMPT to 1 but during the build you can't enter the values and the build will hang.

    To fix the error, just add the username & password or the Personal Access Token (PAT) in the git push command:

    git push https://username:password(or PAT)@github.com/username/reponame.git 
    

    The https://... replace the origin.

提交回复
热议问题