I have a developer workstation provisioning script where I'm am attempting to clone out the base code devs work on.
However, when provisioning credentials to the git credential manager the script is throwing an error.
Script:
# configure git credential manager
git credential-manager-core configure
# add service account credentials to the credential manager; this is where it throws the error
printf "host=private.bitbucket.instance.example.com\nprotocol=https\nusername=GitServiceAccount@example.com\npassword=ComplexPassword" | git credential-manager-core store
# clone out code
git clone https://private.bitbucket.instance.example.com/path/developercode.git
# remove service account credentials from the credential manager
printf "host=private.bitbucket.instance.example.com\nprotocol=https\nusername=GitServiceAccount@example.com" | git credential-manager-core erase
Error:
fatal: Unable to persist credentials with the 'wincredman' credential store.
See https://aka.ms/gcm/credstores for more information.
The information page states "GCM is unable to persist credentials to the Windows Credential Manager due to limitations in Windows".
How can git credentials be stored for use in a provisioning script as seen above?