I need to push a cloned repo back to Github, but when I run git push -u -f origin main
in the folder that I've initialized and added a remote origin to, it returns this error:
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/BusyBird15/WeatherOne.git/'
How do I authenticate myself when the main authentication method has been removed?
The main authentication method for GitHub is SSH, which you can read about in their documentation: https://docs.github.com/en/authentication/connecting-to-github-with-ssh
As a summary, partially taken from GitHub own documentation, you should:
ssh-keygen -t ed25519 -C "your_email@example.com"
chmod 600 keyFile
ssh-add ~/.ssh/id_ed25519
You'll have to then adjust your origins to point to the ssh endpoints of your repository. The one you linked would be: git@github.com:BusyBird15/WeatherOne.git