I have a git authentication problem on Azure DevOps build agent for some unknown reason authentication only works with the MacPorts version of git:
>/usr/bin/git clone --config "http.sslVerify=false" "https://…:…@…/DefaultCollection/…/_git/…"
Cloning into '…'...
fatal: Authentication failed for 'https://…:…@…/DefaultCollection/…/_git/…/'
>/usr/local/bin/git clone --config "http.sslVerify=false" "https://…:…@…/DefaultCollection/…/_git/…"
Klone nach '…' ...
fatal: Authentifizierung fehlgeschlagen für 'https://…/DefaultCollection/…/_git/…/'
>/opt/local/bin/git clone --config "http.sslVerify=false" "https://…:…@…/DefaultCollection/…/_git/…"
Klone nach '…' ...
remote: Azure Repos
remote: Found 25399 objects to send. (22 ms)
Empfange Objekte: 100% (25399/25399), 21.80 MiB | 39.24 MiB/s, Fertig.
Löse Unterschiede auf: 100% (17128/17128), Fertig.
I have tried by best to make the build agent use the MacPorts version:
But still the checkout fails:
##[section]Starting: Checkout
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Syncing repository: repository (ExternalGit)
##[command]git version
git version 2.26.2
##[command]git init "/Work/TFS/1/s"
Leeres Git-Repository in /Users/Shared/Work/TFS/1/s/.git/ initialisiert
##[command]git remote add origin https://…/DefaultCollection/…/_git/…
##[command]git config gc.auto 0
##[command]git config --get-all http.https://…/DefaultCollection/…/_git/….extraheader
##[command]git config --get-all http.proxy
##[command]git remote set-url origin https://***:***@…/DefaultCollection/…/_git/…
##[command]git remote set-url --push origin https://***:***@…/DefaultCollection/…/_git/…
##[command]git -c http.sslVerify=false fetch --force --tags --prune --progress --no-recurse-submodules origin
fatal: Authentifizierung fehlgeschlagen für 'https://…/DefaultCollection/…/_git/…/'
##[warning]Git fetch failed with exit code 128, back off 9.834 seconds before retry.
##[command]git -c http.sslVerify=false fetch --force --tags --prune --progress --no-recurse-submodules origin
fatal: Authentifizierung fehlgeschlagen für 'https://…/DefaultCollection/…/_git/…/'
##[warning]Git fetch failed with exit code 128, back off 8.115 seconds before retry.
##[command]git -c http.sslVerify=false fetch --force --tags --prune --progress --no-recurse-submodules origin
fatal: Authentifizierung fehlgeschlagen für 'https://…/DefaultCollection/…/_git/…/'
##[error]Git fetch failed with exit code: 128
##[section]Finishing: Checkout
So how can I make sure that the correct git executable is used? I tried to search for the script managing the checkout but to no avail.
Update 1: I have deinstall the Brew version of Git but this will only result in the the macOS Version to be used. And I can't deinstall that one.
Update 2: I placed a symbolic link ln -s /opt/local/bin/git /usr/local/bin/git
. That actually works but it's not the best of workarounds and I would like for a more clean solution.