Recently when I use VSCode to clone a git repository to my local computer, I meet the error message Authentication failed on the git remote. This article will tell you how to fix it.
1. Steps To Reproduce The Authentication Failed On The Git Remote Error.
- I use bitbucket to save my example code git repository. And in the past, I use SourceTree to manage the git repository.
- But recently I transfer my example project to VSCode, and I find I can clone the example project repository using the VSCode editor directly. Below are the steps.
- Open a web browser and log in to the bitbucket with your account.
- Click the Repositories link on the top area.
- Then click the git repository that you want to clone to your local computer.
- On the repository detail page, click the Clone button in the top right corner, then it will popup the Clone this repository dialog.
- There are 2 link buttons in the dialog, click the Clone in VS Code link.
- It will pop up a dialog to ask you whether open the VSCode editor to clone the repository or not.
- Click the Open URL:vscode button to start the cloning process.
- Click the Open button in the popup Allow an extension to popup this URI dialog.
- If this is the first time you use VSCode to clone the git repository, it will prompt you to install some VSCode extensions such as the Git extension.
- Then click the Clone a new copy item in the VSCode top area Command Palette… input text box.
- Select a folder where you want to save the new git repository.
- Then it will let you input the repository password in the VSCode top area Command Palette… input text box.
- Input the Git repository password and press the Enter key, then it will show the error message Authentication failed on the git remote.
1. How To Fix The Authentication Failed On The Git Remote Error.
- Log in to the bitbucket website with your account.
- Click your account image on the page top right corner.
- Then click the Personal settings item on the popup item list to open the Personal settings page.
- Click the App passwords link on the page left side, then click the Create app password button on the page right side.
- Input a name ( vscode ) in the Label input text box, and check all the permission checkboxes ( Read, Write, Admin, Delete ) in the Repositories section.
- Click the Create button to create it, then it will popup a dialog and give you a password for the vscode application, store it carefully.
- Now you can use the app password that is created above when you clone the git repository in the VSCode editor to avoid the error occur.