I am executing a batch file in Azure DevOps Pipeline which has following statement.
git init
git checkout -b %BranchName%
git remote add origin %RepoURL%
git fetch && git checkout %BranchName%
The parameters gets the values from Variables. But I am getting the below error.
"Could not read Password for '<Repository URL>': terminal prompts disabled"
I have tried to set the value for the RepoURL parameter as follows.
https://<CollectionName>@dev.azure.com/<CollectionName>/<ProjectName>/_git/<RepoName>
https://<PAT>@dev.azure.com/<CollectionName>/<ProjectName>/_git/<RepoName>
Many post in this forum suggest to use PAT. So tried the git pull statement as follows.
git pull %RepoURL%
But no luck. Still getting the same error. Please anyone let me know how to solve this issue.
Thanks.
According to your description, I use the following method for testing, and it works well.
In order to solve this problem, please check the following things:
1.Enable ‘Allow scripts to access the OAuth token’ in the Agent job options.
In the git remote add origin %RepoURL% use the System.AccessToken: