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

Pushing to remote: Unauthorized

I would like to push my files. When I try to do it, I get a dialog where I have to give my username and password. Everything looks correct but after I press OK, I get the following error message:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/mybranch:refs/heads/mybranch

Pushing to

remote: Unauthorized

fatal: Authentication failed for ''

Pushing to

remote: Unauthorized

fatal: Authentication failed for ''

Pushing to

remote: Unauthorized

fatal: Authentication failed for ''

Pushing to

remote: Unauthorized

fatal: Authentication failed for ''

Completed with errors, see above


I just created my account an hour ago, it might be the reason but I am not sure. How could this issue be solved? It is quite urgent, I have 24hours to complete the push.

Thanks in advance!

1 answer

0 votes
Ana Retamal Atlassian Team Sep 28, 2017

Hi Biró! Are you getting this same error when you try pushing from the command line instead of Sourcetree? If you do, then the issue is not with Sourcetree itself but with the authentication. 

You can try removing all your credentials and entering them again. SourceTree accounts are stored in %localappdata%/Atlassian/SourceTree/accounts.json. If you're on Windows they are stored in the Credentials Manager or Vault with the 'git:' prefix. If you're on Mac, they are stored in the Keychain.

If you're still having issues after trying the above, let us know if you are on Windows or Mac, and also which Sourcetree version are you using.



Hi Ana! I do not try to do it via the command line, I use Sourcetree's user interface. I just press the Push button placed between Pull and Fetch, then I select the Branches to push and click the Ok button.

I am using Mac OSX 10.11.4 (El Captain) and Sourcetree 2.6.3 (134).


Hi Ana,

Is it possible to make the communication faster? My problem is still not solved and I am already 10 hours over the deadline. Could you please contact me via email, phone or Skype?


Thanks in advance,


Ana Retamal Atlassian Team Sep 29, 2017

Hi Biró, if you're able to try the command line it will help us know where the issue is what will lead to a more accurate answer. Can you try pushing from the command line and see if you receive the same error?


Also, can you confirm if you cleared the credentials from the Keychain? It's very possible that the Keychain has the wrong credentials stored for

Lastly, do you have 2FA enabled on your account?
Best regards,

Hi, unfortunately, it is  the same if I do it from the command line. I am 100% sure that I give the correct credentials.


user$ git push -u origin my_branch_name

Username for '': <my bitbucket username>

Password for '': <my bitbucket password>

remote: Unauthorized

fatal: Authentication failed for ''

I cleared the credentials from the keychain too. But anyway, when I tried to push via the command line my password and username were required (were not filled automatically by keychain). And if I understand it well, I do not have 2FA (two-step verification?) enabled on my account. When I navigate there, it says:

It looks like you aren't quite ready to set up two-step verification on your account. You'll need to address the following items before continuing.

Suggest an answer

Log in or Sign up to answer
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,962 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