This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Github vs. GitHub Enterprise + GCM modalPrompt vs. store #817
Labels
github
Related to GitHub hosting or GitHub Desktop.
Hi,
This is a long standing issue that only surfaced for us recently.
We leverage the GCM CLI to automatically pre-populate Github and Github Enterprise credentials for some users.
Github:
GHE:
This methodology worked for us until we deployed a version
>= 1.15
where GCM introduced a new feature, #547 "Respect Usernames in Repository URLs". Prior to version1.15
, the URLs stored by GCM, did not contain a username and as such, Git operations (i.e. clone, pull, etc) on URLs that also do not contain a username, worked...Example:
git clone https://our.ghe.local/the-user/some_repo.git
After version
1.15
, the only way to perform a clone in this manner and not be prompted for credentials (aka get GCM to recognize the target Git URL) is to add the username.Example:
git clone https://[email protected]/the-user/some_repo.git
This represents a significant shift in behaviour and is made more confusing because setting
host=github.com
behaves differently than any other host. I assume this is because public Github does not support thehttps://username@host
URL scheme and is therefore given a pass.However, it is interesting to note that in the absence of matching credentials, setting them using the
modalPrompt
functions normally and creates an appropriate URL.Full Example for GCM
>= 1.15
git credential-manager store
per abovegit clone https://our.ghe.local/the-user/some_repo.git
fails, but induces themodalPrompt
username
andpassword
This is impractical for automation, but I have only found one workaround so far...
git config --global credential.microsoft.visualstudio.com.username the-user
But this has the unfortunate drawback described here.
Still, given the discrepancy between how the
modalPrompt
and the store function operate, I am not sure whether this is a bug or expected behaviour.Perhaps there are some other workarounds?
Thanks!
The text was updated successfully, but these errors were encountered: