Affects Version/s: 7.0.0
Fix Version/s: None
I just tried to retrieve my cordova plugin which lives in a private repo from git ssh url. Therefore I want to use the SSH url which is the following:
As you can see the user is myuser.
If I now run
cordova plugin add git+ssh://email@example.com/myuser/cordova-plugin-xyz.git
I get the following error:
npm ERR! Command failed: git clone --template=/home/localuser/.npm/_git-remotes/_templates --mirror ssh://firstname.lastname@example.org/myuser/cordova-plugin-xyz.git /home/localuser/.npm/_git-remotes/ssh-git-bitbucket-org-myuser-cordova-plugin-xyz-git-160b6243 npm ERR! Klone in Bare-Repository '/home/localuser/.npm/_git-remotes/ssh-git-bitbucket-org-myuser-cordova-plugin-xyz-git-160b6243' ... npm ERR! repository access denied. npm ERR! fatal: Could not read from remote repository.
As you can see cordova tries to get the plugin by the url
which sets git as user which is wrong in my case.
The problem is that I have multiple accounts for bitbucket and also 2 ssh keys on my machine. Unfortunately, the cordova cli tool seems to force checking out by the user called "git" and not what I'm adding into the command (myuser).
Is there any way to override that behavior of cordova cli to always take git as user?
Also I tried to create a "config" file in ~/.ssh and vary the host (as described here developer.atlassian.com/blog/2016/04/… ) which also doesn't work (cordova cli tool says unsupported URL format).
Why doesn't the cordova cli tool simply takes my url as passed in!??!