Problem
I am trying to deploy my code through a Azure Devops release pipeline by executing a powershell script which checkouts the master branch and pulls on our productive server:
cd "C:\..."
git checkout master
git pull
this produces an error when I am trying to execute git pull:
fatal: could not read Username for 'https://acino.visualstudio.com': terminal prompts disabled
The script works without a problem when I execute it from the server itself. It fails only when I use the release pipeline.
Troubleshooting
• The error message would let me believe that the user name is not set when executing git pull, However if I add the following two lines to the code
git config user.name
git config user.email
I see the correct user name and email address being printed.
• The other guess is that it is trying to pull from the wrong origin, since 'https://acino.visualstudio.com' is not the URL of my repository. So I have tried also to append the repository name to git pull
git pull https://URL to my repository
with no luck.
I am therefore don't really understand what the problem is really. Any input, comment,suggestion is welcome.
FYI: I am aware that executing git pull in a release pipeline is not perhaps the standard way of deploying code. I have also build other more conventional deployment pipelines which work. However, due to our directory/project structure using git pull would be optimal solution as I see it.
Kind Regards, Rok Bohinc