Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-2029

Sourcetree Fails on Password When Cloning To Submodule

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • None
    • 1.8.0.3
    • Git
    • None
    • MAC OS X 10.8.5

    • Severity 3 - Minor

      Giles Hammond asked this question · 16 karma · Dec 18 at 05:48 AM

      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

      (Related AAC: https://answers.atlassian.com/questions/244606/sourcetree-fails-on-password-when-cloning-to-submodule)

          Form Name

            [SRCTREE-2029] Sourcetree Fails on Password When Cloning To Submodule

            Not fixed in version 4.1

            Allan.teague added a comment - Not fixed in version 4.1

            Manju added a comment -

            Fixed in version 4.0

            Manju added a comment - Fixed in version 4.0

            I just started getting this issue, I am using SourceTree version 2.7.2. I have tried many solutions but still in vain

            Muhammad Yousuf Saif added a comment - I just started getting this issue, I am using SourceTree version 2.7.2. I have tried many solutions but still in vain

            Michael S Wilde added a comment - - edited

            I might have solved part of this.  I have the same errors when trying to use "Git Flow" in sourcetree.

            AT CLI, i typed "git config credential.helper"

            the response was "osxkeychain"

            I changed it to sourcetree by doing this.

            git config credential.helper sourcetree

            When i used git flow again, sourcetree popped open a dialog box asking for my bitbucket server password (3 times)... not sure if it totally works tho.. gotta figure out.

             

            Michael S Wilde added a comment - - edited I might have solved part of this.  I have the same errors when trying to use "Git Flow" in sourcetree. AT CLI, i typed "git config credential.helper" the response was "osxkeychain" I changed it to sourcetree by doing this. git config credential.helper sourcetree When i used git flow again, sourcetree popped open a dialog box asking for my bitbucket server password (3 times)... not sure if it totally works tho.. gotta figure out.  

            This is especially annoying if you are using GitHub to host both repositories and are using 2FA. You have to clone the main repo using HTTPS and a token as the password. But when the URL to the submodules origin is a SSH URL then Sourcetree will fail; it will try to use HTTPS authentication for the SSH URL and prompt for the HTTPS password again and again.

            Wojciech Duda added a comment - This is especially annoying if you are using GitHub to host both repositories and are using 2FA. You have to clone the main repo using HTTPS and a token as the password. But when the URL to the submodules origin is a SSH URL then Sourcetree will fail; it will try to use HTTPS authentication for the SSH URL and prompt for the HTTPS password again and again.

            thinsoldier added a comment - - edited

            If you click the "Hosted Repositories" button (earth icon) you will always get the https url

            If you attempt to proceed with this URL it will not work.

            Instead you need to go to the bitbucket.org website and copy the ssh friendly version of the url.

            thinsoldier added a comment - - edited If you click the "Hosted Repositories" button (earth icon) you will always get the https url If you attempt to proceed with this URL it will not work. Instead you need to go to the bitbucket.org website and copy the ssh friendly version of the url.

            thinsoldier added a comment - - edited

            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.

            thinsoldier added a comment - - edited 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.

            varcess added a comment -

            Hello,

            we have found a workaround for this bug...

            1. create a normal Clone on your workstation of the repository which should be the submodule
            2. open the repository where the submodule should be integrated
            3. create a submodule and use the local repository this works fine, because there is no authentication needed
            4. change the source url (now the local path) of the submodule to the servers url (like https://servername/scm/...git) via the context menue
            5. open the submodule and change the remote settings to the servers url
            6. optional: you can delete the local repository of the submodule, which you created in step one

            This has been working for us on Mac OSX version of sourcetree.

            Just one hint at this point. If you delete a submodule of this kind, sourcetree doesn't show any submodule. In this case you have to commit the changes to .gitmodule and close sourcetree and reopen it. Then the submodules are back again.

            best regards
            Daniel

            varcess added a comment - Hello, we have found a workaround for this bug... 1. create a normal Clone on your workstation of the repository which should be the submodule 2. open the repository where the submodule should be integrated 3. create a submodule and use the local repository this works fine, because there is no authentication needed 4. change the source url (now the local path) of the submodule to the servers url (like https://servername/scm/...git ) via the context menue 5. open the submodule and change the remote settings to the servers url 6. optional: you can delete the local repository of the submodule, which you created in step one This has been working for us on Mac OSX version of sourcetree. Just one hint at this point. If you delete a submodule of this kind, sourcetree doesn't show any submodule. In this case you have to commit the changes to .gitmodule and close sourcetree and reopen it. Then the submodules are back again. best regards Daniel

            Having the same issue on Version 2.0.5.2 (2.0.5.2).

            Marina Gornostaeva added a comment - Having the same issue on Version 2.0.5.2 (2.0.5.2).

            varcess added a comment - - edited

            Hello,

            we are still facing the same issue. We use sourcetree version 2.0.5.2 on OS X 10.10.2 with stash version 3.5.0 running on top auf a windows 2012 R2 server...

            The git repositories are hosted on the same server. Using the same credentials I can clone the repository as a normal git repository but not as a submodule.
            Best regards
            Daniel

            varcess added a comment - - edited Hello, we are still facing the same issue. We use sourcetree version 2.0.5.2 on OS X 10.10.2 with stash version 3.5.0 running on top auf a windows 2012 R2 server... The git repositories are hosted on the same server. Using the same credentials I can clone the repository as a normal git repository but not as a submodule. Best regards Daniel

              Unassigned Unassigned
              92e1b8cb8c32 Azizur Rahman
              Affected customers:
              21 This affects my team
              Watchers:
              22 Start watching this issue

                Created:
                Updated:
                Resolved: