When I push my source code changes in SourceTree to the bitbucket server, it popup a dialog to let me input the username and password. But whatever password I entered ( including the correct password), it will fail to push the changes to the bitbucket server. This error occurs when I fetch or pull the changes from the bitbucket server also. This article will tell you how to fix it.
1. Steps To Fix Authentication Failed For Bitbucket Pull Push Fetch Actions.
1.1 On macOS.
- On macOS, you should click the Sourcetree —> Preferences… menu item to open the General window.
- Click the Accounts tab, then select the user account from the below list.
- Click the Edit… button at the bottom of the window to open the account edit window.
- Select the OAuth item from the Auth Type drop-down list.
- Then click the Connect Account button, it will open a web browser to show the bitbucket account login page.
- Input the correct username (email) and password to log in successfully.
- Then it will go back to the SourceTree client, you can click the Save button to save the changes.
- Then you will find the authentication failed error has been fixed when you pull, push, fetch from the bitbucket server.
1.2 On Windows.
- On Windows, open the SourceTree application.
- Click the Tools —> Options menu item on the top menu bar to open the Options dialog window.
- Click the Authentication tab to list all the accounts.
- Click the Edit link below the user account to open the Edit Hosting Account dialog window.
- Select OAuth from the Credentials —> Authentication drop-down list.
- Then click the Refresh OAuth Token button.
- It will open a web browser to let you log in to the bitbucket website.
- After you successfully log in to the bitbucket website, click the OK button to save the changes.
- Now the error will be fixed.