I have a repository on BitBucket, created by importing the public Sparkle for OSX project from Github.
If I try to clone this to my local machine with Sourcetree everything works fine:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone --recursive https://MyUsername@bitbucket.org/MyUsername/sparkle.git /Users/Giles/Dropbox/Projects/sparkle
However, if I try and do the same to a submodule within an existing project it fails with a password issue:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree submodule add -f https://MyUsername@bitbucket.org/MyUsername/sparkle.git External/Sparkle fatal: could not read Password for 'https://MyUsername@bitbucket.org': Device not configured
Does anyone know if I am doing something very wrong here? I am fairly new to Git, Sourcetree and Bitbucket. Perhaps this is a bug though - the password is obviously working when cloning in some instances.
Sorry everyone, this hasn't fallen on deaf ears.
I believe this is because we're now using a credential helper which appears to not play nicely with checkout of submodules. The credential helper just gets auth details from the keychain, but I'm guessing submodule clones don't work with credential helpers.
It's logged (as mentioned above) at https://jira.atlassian.com/browse/SRCTREE-2029so we can look into it from there. This is a pretty major problem so I'll get on it urgently.
As a workaround:
Use commandline to get the submodule:
git submodule add <repository url> <local relative path>
(See Progit - 6.6.1 Starting with submodules)
Then when you go back to Sourcetree it picks it up and the credential helper asks you for access to keychain and everything seems to work OK.
Just to shime in with the workaround I found, and it works very well and is a no brainer:
1: in the General Preferences of SourceTree, check "Always display full console output"
2: do your submoudle cloning action as you would expect
3: when the error popups up, simply look up the actual call made in the console, and copy paste it in your Terminal, and execute it from there
4: the terminal will prompt you for the password, simply enter it
5: done, you have your submodule implemented.
Explanation: basically it says it can not read the password, because sourcetree when executing the git command fails to forward the password prompt to the user with a UI dialog, that's all. so simply get the git command sourcetree executes for you and execute it manually
Hope this helps while sourceTree addresses the problem.
More workaround info The Sourcetree UI seems to utilize the *HTTPS* urls (https://email@example.com/thinsoldier/testproject.git) by *default* _whenever you do *anything*_. If you instead manually enter the *SSH* urls (firstname.lastname@example.org:thinsoldier/testproject.git) *_wherever possible_* (cloning, adding a remote, adding a submodule) then the submodule related activities will succeed. But you of course need to set up an SSH key on your machine and add it your profile on bitbucket.org.
For even less hassle:
If you tick out "recurse submodule" during cloning of the parent repo, and then you double-click on the submodule, SourceTree is magically able to provide you a form to fill with your password. Which is not rocket science, nor the solution, if someone here is reading...
I am having the same problem with the latest version of SourceTree (18.104.22.168).
However, on another machine running an older version (22.214.171.124) it works fine.
So I think this is a bug in latest version of SourceTree. How it picks up passwords for cloning submodules no longer seems to be working.
You could always convert to using subtree. I know that sounds like a convultated answer, but subtree was kind of designed as a replacement for submodules as it's more flexible, and we now support it in SourceTree (for Mac).
I'll be working on a fix regardless though which will get issued for 1.8.1 most likely.
Still happens in Version 1.9.1 (1.9.1). Clonning repo works fine, but adding it as submodule gives fatal:
fatal: could not read Password for 'https://email@example.com': Device not configured
Quite annoying - so much effort went into UI redesign and not so much into basic funtionality bugfixes.
Just as an update on this issue, it's because the submodule is on a separate host to the parent repository. The Git auth helper doesn't (or at least, didn't) give enough information to distinguish auth details which fails to provide the password. If the submodule were on the same host it should work OK.
I'm going to look into this one again as the auth model has changed since these problems, so we might be able to address it. When you do this from the terminal it might even fail from there, too.
We're looking into it regardless as we want to see some solution or middle ground. Cheers
How's the progress going on this? I'm actually having the same problem on 1.9.2 and the hosts are the same. I have a project tracking a remote on bitbucket and I'm trying to clone in as a submodule another repo stored on bitbucket and getting the same error. Will try the terminal solution and see if that works, obviously would be nice to be able to do it through the SourceTree GUI though.
Found something that might be related. For some reason, the submodule is causing problems with the deployment setup as well. We're using DeployHQ for automatic deployment of our bitbucket repo but the latest deployment after adding the submodule failed and the error was the exact same I got in SourceTree-
fatal: Authentication failed for...
Followed by the repo https URL.
Hey Community! I’m Shana, a member of our DevOps team here at Atlassian. I wanted to make sure you saw our announcement last week about the launch of Open DevOps since you may have missed it amidst a...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events