It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trying to clone repository, can't supply password

Hello,

I'm working in SourceTree and I cannot clone my repository. Here's what I enter into the dialog:

trying to clone promcom repo.png

But it tells me "This is not a valid source path / URL". When I click on the Details button, it tells me "Invalid username or password...".

I have confirmed that the url is correct and that my username is correct. I'm trying to figure out how to supply the password. Can you please help me figure out how to supply the password.

Thanks.

2 answers

0 votes
minnsey Atlassian Team Feb 14, 2018

Hi 

It looks like you are using an older version are you able to update to the latest build form https://sourcetreeapp.com ?

Hi Michael,

I updated to the latest version of SourceTree. In addition to that, I entered the URL without my username. This time it prompted me for login credentials.

But now my login credentials won't work! I keeps re-prompting me! I should enter the same login credentials that I use to log into my BitBucket account, shouldn't I?

UPDATE:

The error I get is slightly different now:

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false ls-remote https://gibran_shah@bitbucket.org/gibran_shah/riskalive.git
Output:
Error: Logon failed, use ctrl+c to cancel basic credential prompt.
error: unable to read askpass response from 'C:\Users\gshah\AppData\Local\SourceTree\app-2.4.7\tools\Askpass.exe'
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Password for 'https://gibran_shah@bitbucket.org/': No error

This seems to say it is trying to get the password from Askpass.exe. <-- Not sure what that it or why it's failing.

Like demijan.juric likes this
minnsey Atlassian Team Feb 15, 2018

Hi

It is better to use a URL that contains you username. Sourcetree relies on Git to andle authorization. Git does that by using the Git Credential Manager, GCM, that is bundled with Git for Windows.

Git alone only has the ability to ask for a password when run from the command line, the GCM provides the popup GUI dialogs that allow git processes triggered by Sourcetree to interactively prompt the user for credentials.

The GCM stores its credentials in the Windows Credential Manager, also referred to the Vault, you can access this through Windows Settings. The GCM creates/uses entries prefixed by 'git:'.

If you use a URL without a username,  e.g. https://bitbucket.org/username/myrepo, then the GCM will store credentials against git:https://bitbucket.org . This means anytime Git/GCM need to find credentials for use against bitbucket it will find and use these credentials. This works fine unitl you are using more than one account to access bitbucket. When that happens, and you are using URLs without usernames, Git/GCM will keep finding the current credentials and trying to use them, if they are correct for the repo you are trying to access they will work, if they are wrong Git/GCM will delete them, prompt you for the correct ones and then store the new ones. If you switch between repos and accounts this process will repeat endlessly.

 

If you use URL that do include usernames then the credentials are stored keys against, git:https://username@bitbucket.org, so each time you switch repos and accounts/usernames and you are using URLs with names Git/GCM will find the exact match.


As for Askpass.exe that should be installed at C:\Users\gshah\AppData\Local\SourceTree\app-2.4.7\tools. It is part of the Sourcetree install. Askpass.exe is a last chance fallback for authentication it should only appear if the GCM failed to get credentials it can use.

Hi Michael, thanks for the detailed feedback. I managed to solve the problem. The credentials prompt would always come up 3 times. What I didn't recognize at first was that on the third time, my username was auto-filled. This made me wonder: if it's recognizing my username on the third try, maybe it will also recognize my password. So I entered my password on the third try and presto! SourceTree has now cached my credentials and I'm able to connect to my repository automatically with my username in the url.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,927 views 0 12
Read article

Community Events

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

Events near you