Authentication failed

I am trying to push my project through the https protocol on a bitpack using sourcetree.
But I can’t connect to bitbucket with my username and password (which work on the website), I have a fatal error: "Authentication failed."

I read on other posts, I can get around the problem using the ssh protocol instead of https one, so I set the ssh key following the instructions in the faq source tree . But now I do not know how I can change the ssh protocol when I want to press my code. Does anyone know how I can do this? Thank.

+69
bitbucket atlassian-sourcetree
Jan 06 '14 at 16:01
source share
22 answers

If you are having authentication issues in the GIT console, you can try your auth as follows:

https://<username>:<password>@bitbucket.org/<username>/<repo>.git 
+100
Feb 11 '14 at 20:26
source share

I recently had a similar problem with SourceTree: whenever I tried to push / pull / pull from / to a remote source, I would get an authentication error (using SourceTree with Stash). Sometimes I could challenge STASH using CAPTCHA, but it did not change the situation if I provided the correct information or not.

For me, we use SourceTree and Stash in a corporate environment; user accounts are based on network credentials. Part of our network security requires us to regularly change these passwords.

I worked under the assumption that SourceTree / Stash "knew" about any changes made to my network password. But, apparently, at least in this case - this is not so.

To fix this, I only needed to:

Tools> Options> Authentication> Change (Change Password)

I set the password according to my current network password and everything started working as expected.

Not sure if this helps the OP, but I hope this helps someone else find answers to a similar problem.

+41
Mar 18 '15 at 21:02
source share

Tools -> options -> git and choosing 'use system git' did the magic for me.

+19
Aug 21 '17 at 9:25
source share

I solved the problem by editing the saved value in the "bitbucket" of the OS X keys : I searched for "bitbucket" (as the application password) and changed the value.

Then on Sourcetree , when I tried to click, I had to re-enter my new password.

+16
Feb 16 '17 at 10:45
source share

The problem was solved for me after changing the repository password, without special characters (! "§ $% & &).

Obviously, win-credential-store and git and the bitbucket web interface use different character encodings.

full procedure:

 D:\shared\Project> cd /path/to/your/project D:\shared\Project> git init D:\shared\Project> git remote add origin https://bitbucket.org/USERNAME/project.git D:\shared\Project> git-credential-winstore.exe 

then

 D:\shared\Project> git push Failed to erase credential: Element not found fatal: Authentication failed for 'https://bitbucket.org/USERNAME/project.git/' 

After changing the key phrase:

 D:\shared\Project> git push Counting objects: 102, done. Delta compression using up to 8 threads. ... etc. ... 

Settings in Windows tresory:

 address: git:bitbucket.org (remeber the preceding "git:") user: USERNAME pass: old incl!"§§$%&, new without!"§$%%&/( (your passphrase!) 
+10
Jun 08 '15 at 9:39 on
source share

I returned to sourcetree 2.0

This solved the error for me.

https://www.sourcetreeapp.com/download-archives

+5
Aug 16 '17 at 8:10
source share

I had the same problem. This is somehow related to a bug in Git for Windows. For me, it was enough to change the Git used in SourceTree to the built-in:

Tools -> Options -> Git and click on "Use embedded Git"

+4
Aug 18 '17 at 13:51 on
source share

I tried everything else and found helplessness, but it really helped me: “To update my credentials, go to Control Panel → Credential Manager → General credentials . Find the credentials associated with your git account and edit them to use updated passwords. "

The above solution was found at this link: https://cmatskas.com/how-to-update-your-git-credentials-on-windows/

+3
Mar 06 '18 at 7:50
source share

If you made an account using google / other oauth, you must first set a battle password for your account. URL for this: https://bitbucket.org/account/user/ / or find the Bitbucket settings in the menu.

Then you can log in from git (I tried through the command line). I use the built-in manager for credentials:

credential.helper = manager

Now, after I set the password on bitbucket (also confirmed the email address), and tried to click again, he prompted me for the password, then clicked the code.

Image of the location of the menu on the Bitbucket web page → http://ctrlv.in/747291 since May 2016.

+2
May 2 '16 at 15:52
source share

Tools > Options > Use System Git , then select the git.exe file

enter image description here

Credentials will be required again and the problem will be resolved.

+2
Jan 10 '18 at 23:49
source share

I had the same problem. You need to go and add the application password for sourcetree in the settings of your bitpack. Click "Bitbucket Settings" in the menu, application passwords, create an application password. Then go to SourceTree and edit the saved password

+1
Mar 08 '17 at 0:20
source share

On a Mac, I needed to go to Preferences > Accounts , and then add a new account as Bitbucket Server and enter the URL of my bitbucket server. Then I had to select HTTPS as the protocol and enter my username (without @email) and password.

I also set this new account as the default account by clicking the Set Default... button at the bottom of the Preferences > Account page.

+1
Jul 05 '17 at 21:13
source share

This issue occurs because the password of your git account and your computer may be different. Therefore, provide your username, as shown in the following example:

https://myusername@bitbucket.org/...

https://devi@bitbucket.org/...

+1
Feb 26 '19 at 11:35
source share

None of the above worked for me - the problem was my Sourcetree preference. On the "Network" tab, I had the setting "Default username for URLs that do not include:". The username was incorrect when I entered it incorrectly earlier - I set it to my email address and not to the username. I highlighted the entries and clicked "Delete" for both. Then I returned to the page of my repository and again clicked the "Start" button. When pressed, he asked me to enter the full username and password, which I could enter correctly - pressing then finally worked.

0
Apr 03 '17 at 9:51 on
source share
  • Inside the company, but it will remain true anywhere.
    • Quit Bitbucket (in case you use)
    • Login with your credentials
    • Back to console
    • Run the same command
    • He will ask for a password - enter it.
    • You are good to go.
0
Jul 21 '17 at 7:45
source share

For me, the problem was that I did not have an account added to Sourcetree.

Adding an account allowed me to switch to repo:

Tools> Options> Authentication> Add> Refresh OAuth Token

enter image description here

0
Jun 30 '18 at 15:40
source share

After a long struggle with this, it looks like I found something that seems to work. I optimized the URLs to not include the username (keep it as universal as possible), but the authentication dialog kept popping up:

enter image description here

I tried everything that came to mind, for example:

  1. Enable and disable MFA (multi-factor authentication)
  2. Create application passwords (again, with and without MFA enabled)

No matter what tools I used (including SourceTree), nothing worked. The server kept returning: "Create application password"

Basically you should

  1. Use the URL, including the username (e.g. https: //myusername@bitbucket.org / ... )
  2. Use the application password created in bitbucket

It would be great if the server returned this in the response instead of suggesting to use the application password ...

0
Aug 07 '18 at 8:43
source share

For Mac users. A default account was set in the source tree, which allows me to clone the url as my current url had a different bitbucket account. So, it shows the wrong source path, and then I click on Advanced options and find that authentication failed for your_clone_url. So follow these steps

  1. Select Source Tree. Go to SourceTree → Choose Settings.
  2. This will display a new window. Then select accounts enter image description here

Here it will show a list of your accounts. Just click the Add button below and add your Bitbucket account details. He will list your account on the Accounts tab. You can also set a default account by clicking the Set Default .. button below. Now everything is done.

0
Sep 19 '18 at 7:16
source share

I tried almost all the solutions given here.

What worked for me, I opened the GIT GUI and tried to click. Which asks for credentials, enter the correct user ID and password, it will start working again.

0
Mar 29 '19 at 15:32
source share

I used the command below

 git clone -b branch-name https://<username>@bitbucket.org/<repository>.git 

The problem was resolved after adding the password with the username (see below command):

 git clone -b branch-name https://<username>:<password>@bitbucket.org/<repository>.git 
0
Apr 11 '19 at 14:09
source share

I solved the problem by following these steps on macOS.

  1. Reached the folder ~ / Library / Application Support / SourceTree
  2. Delete the file {username rout@STAuth-bitbucket.org
  3. Restart Sourcetree
  4. Try to receive, a password will appear, enter a new password
  5. You can also run the git fetch command in the terminal and enter the password
  6. Done
0
May 31 '19 at 6:49
source share

On windows, this works for me

git config --global http.sslVerify false

0
Jun 19 '19 at 16:25
source share



All Articles