When I try to push to a repo I've cloned down via HTTPS protocol, it tells me to enter my username and password, then promptly errors with
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/pavelkomarov/repo.git/'
First of all, why on earth is the git client asking me for a username and password only to then tell me "Sorry, I don't accept those anymore, teehee "?
Second, is there even a way to push using HTTPS? I've only gotten push
to work over SSH. Do you have to dig in to the git config and put some kind of key there, or is there literally just no path to do this anymore? If it's the former, it's so wildly is non-obvious how that I'm getting the impression it's the latter.
Third, why default to HTTPS when SSH is more functional? To me this is a case of Why do we even have that lever!?" Is it just that they don't want all users to have to do SSH key creation and adding, while expecting super users to be able to figure it out? But honestly it seems like my whole team has to do these steps anyhow!
They actually boil down to not that much:
cd ~/.ssh && ssh-keygen
followed bycat id_rsa.pub | pbcopy
- navigate on the website to user settings -> SSH and GPG Keys -> add key button -> paste -> green button to complete
- make sure you're using the SSH protocol with
git remote set-url origin git@github.com:user-name/repo-name.git
This is simple enough to describe in the client's error message, or at least to put as top-line items at that web article where the error message directs users.
I've run in to this nonsense several different times over the last few years, because honestly I don't set up git on a new machine often enough to remember all these steps, and the documentation around this is overly verbose and doesn't direct you to do the minimum viable set of actions to enable push
.