Missed Team ’24? Catch up on announcements here.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree for Windows won't authenticate unless the username is in the .git/config file

I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 9, 2023

Sourcetree seems to have trouble pulling and pushing from Bitbucket (remote: Login failed due to incorrect login credentials or method) on a number of working working copies with various origins.  It will pop up a dialog to enter a username and password (which work at https://bitbucket.org/), but it seemingly doesn't pass them along to Bitbucket.  Another git client is able to pull and push from Bitbucket on the same working copies.

Comparing working copies which do and don't work with Sourcetree led us to discovering that Sourcetree seems to require that the username (followed by "@") be embedded in the remote URL, something like:

[remote "origin"]
       url = https://my_bitbucket_username@bitbucket.org/my_project_url.git

I can see how embedding the username in the URL might be a reasonable way of specifying the default.  What seems broken to me is that if it is omitted from the URL, Sourcetree prompts for the username but apparently doesn't use it, as I can't log in even if I use the same username at the prompt.  I would like it if the username in the URL was optional, and the username I enter when prompted was used to log into Bitbucket.


I think the above info is enough to deal with the essence of the issue.  It has implications that affect how my team works.  Specifically, we have some projects which rarely get worked on (never more than one person at a time - the binary files can't be merged) which have working copies stored on a shared networked drive (we don't have separate working copies for each team member).  It is really convenient for any member of the team to be able make changes to the shared working copy, then push them to Bitbucket.  Sourcetree makes that difficult, allowing only the person whose Bitbucket username is embedded in the URL to do so.  It will prompt others for a username/password, defaulting the username  to the one embedded in the URL.  It seems that they can override that default, entering valid Bitbucket credentials, but the pull/push still fails.  I have a feeling that if the problem as originally described was fixed, this would also work.

FWIW, another git client works well in this scenario if we remove the username from the URL, but fails with the username included.  We don't want to push everyone to use the same client, but it would be a solution to this issue.

Any suggestions that might help us work around this issue would be great.  A change to Sourcetree would be even better!  Thanks.


0 answers

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events