I got this error on my console or on my Git Bash when I tried to use
git push -u origin main
Logon failed, use ctrl+c to cancel basic credential prompt. remote: Support for password authentication was removed on August 13, 2021. remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication. fatal: Authentication failed for 'https://github.com/JaseemKhan211/myNatours.git'
It's weird because today I have a lot of time to fix this error. To push the code to my GitHub repository, I open Git Bash and run the first command.
git init
then, all commands are run one by one
git status
git add.
git status
git commit -m "first commit"
git status
git remote add origin https://github.com/JaseemKhan211/myNatours.git
git push -u origin main
The last executed command resulted in a window open, prompting for a username and password to be filled. However, upon attempting to fill out this information, an error was displayed in the console.
I fixed the problem just simply by upgrading Git to the latest version!
Now instead of adding your username/email and password, you will login with your browser. The image below is the new interface you must update your Git to see the new changes!
enter image description here
If you are using Windows, you can simply use this command below to update your Git:
git update-git-for-windows
Then update Git and then proceed to run the last command once more
enter image description here
After successful login, we got this message
enter image description here