I am not sure where this error should be posted, direct me to the right place if this is not the one.
Org: https://o365exchange.visualstudio.com
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
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Note:
Here is my powershell script:
$branchName = $env:BRANCH_NAME;
Write-Host "Getting SHA for last commit in the latest release" -ForegroundColor Blue;
$latestReleaseCommitSHA = git rev-list --tags --max-count=1;
if([string]::IsNullOrEmpty($latestReleaseCommitSHA)) {
Write-Host "Unable to get the SHA for last commit in latest release" -ForegroundColor Red;
EXIT 1;
}
Write-Host "SHA for last commit in the latest release is '$($latestReleaseCommitSHA)'" -ForegroundColor Green;
Write-Host "Merging Changes till '$($latestReleaseCommitSHA)'" -ForegroundColor Blue;
git merge $latestReleaseCommitSHA
Write-Host "Checking Conflicted Files";
$conflictedFiles = git diff --name-only --diff-filter=U
if (-Not [string]::IsNullOrEmpty($conflictedFiles)) {
Write-Host "Unable to Merge" -ForegroundColor Red;
Write-Host "There are conflicts in below files:" -ForegroundColor Cyan;
Write-Host -Object $conflictedFiles -ForegroundColor Cyan;
EXIT 1;
}
Write-Host "Merged changes to '$($branchName)'" -ForegroundColor Green;
Write-Host "Pushing changes." -ForegroundColor Blue;
git push origin HEAD:$branchName
Write-Host "Pushed the changes to the $($branchName) branch." -ForegroundColor Green;
@muthurathinam how did you setup your credential in your git config? you can also debug git with setting environment variable GIT_CURL_VERBOSE.
@TingluoHuang I have fixed this by using pushing my code with
git push https:// [email protected]/username/reponame.git
Thank you!
How can i push only using uname and passwd . I dont want to use PAT ? Let me know .
Most helpful comment
@TingluoHuang I have fixed this by using pushing my code with
git push https:// [email protected]/username/reponame.gitThank you!