Sourcetree Fails on Password When Cloning To Submodule

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.

Thank you

17 answers

1 accepted

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.

Cheers

I still have this problem 1 year and 6 months later.

Still have this problem, almost two years later. Two years, CARL!

check my answer for this, it works and is trivial as a workaround, but I agree this should have been fixed 10 times by now.... https://answers.atlassian.com/questions/244606/answers/19139768

This problem still exists in May 2016!

.... it's been almost 3 years now... just saying..

fwiw, I have the same issue for SubTrees on Windows 10, SourceTree version 1.9.10.0. I get a "fatal: could not read Password" error when I try to pull or add a new https repo as a subtree.

This problem still exists om Feb 2017!!

Still a issue..

@Kieran Senior, you stated here that "this is a pretty major problem", but the ticket at https://jira.atlassian.com/browse/SRCTREE-2029 has it listed as "low priority".  Why?

It's 2018, we're still here. I'm not adding other comments, since I won't be nice.

Started in 2014 now we're here... haha it's September 2018!

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.

Steven

Hi,

 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.

 

Bye,

 

 Jean

I can confirm that this worked for me. This issue definitely should have been fixed by now 3 years later!

4 years, and counting..

cheers ( & thanks)

I had this issue on the latest version (2.0.5.2), but I found if I use the ssh link to my submodule instead of the https link it works fine.  

More workaround info The Sourcetree UI seems to utilize the *HTTPS* urls (https://thinsoldier@bitbucket.org/thinsoldier/testproject.git) by *default* _whenever you do *anything*_. If you instead manually enter the *SSH* urls (git@bitbucket.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...

Thanks. This worked for me. I was unsure whether "tick out" meant tick/check or untick/uncheck, but as the default was set to unticked I ticked it and it worked. 

Hello,

I am having the same problem with the latest version of SourceTree (1.8.0.3).

However, on another machine running an older version (1.7.4.1) 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.

Steven

Thank you Steven - that saves me from thinking I am going mad.

I am getting the same issue as well with SourceTree Version 1.8.0.3 (1.8.0.3)

I have logged this as a Critical Bug: SRCTREE-2029

Hello.

I'm having the same issue, trying to clone to a submodule from a repository on a local SCMManager server.

SourceTree Version 1.8.0.3 (1.8.0.3) for Mac OSX (10.9.1)

Any workaround exists for this bug ?

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.

Cheers

The thing is, i used subtrees before, and that's not really convenient when you have to work with a team. With submodules they know they didnt do something right (like updating a submodule) if they try to clone or pull the repo and make fails. :)

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://username@github.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.

FYI, worked with terminal.

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.

Same here, it is a shame.. should have stayed with the old version :-(((

I've spent an entire day on this and I'm left without any solution. Using Bitbucket hosting + Bitbucket software.

Seriously...

Just spent a couple of hours around this only to find that it's not possible. Seems like an essential feature that's being overlooked for some reason... Any news on a fix?

Same here,

 

 It should really be addressed by now...

Fix it, please. 11/04/2018, last version still not working. Users need this.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 08, 2018 in Teamwork

If you could delete any meeting from your calendar, which one would it be?

Let’s face it: most of us have too many meetings on our calendars. And few things are a bigger waste of time than recurring meetings that no longer provide any value to attendees (or the busines...

391 views 16 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you