I'm currently working on a script which syncs several git repositories and updates them locally with git fetch --prune and git pull.
Now I try to automate the first run of the script, where the git credential manager would prompt for the remote credential.
Is there any change way to check / test if there is already set a credential for the remote (origin) with PowerShell?
Note: I already tried to find a workaround with libgit2sharp but got stuck...
Used Approach
Get-StoredCredential -Target "git:https://<GitLab_FQDN>"You can use
git config --list --show-origin
In case of credentials you can see something like credetial.helper=wincred.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With