remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/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でリポジトリをクローン・プッシュする場合は「パーソナルアクセストークン(Personal Access Token)」または「SSH認証」を使う必要があります。
1. SSH経由でクローンする
もしSSHキーを登録済みなら、次のコマンドでクローンできます:git clone git@github.com:{リポジトリ情報}
2. HTTPSの場合はパーソナルアクセストークンを使う
HTTPSでアクセスしたい場合は、GitHubでパーソナルアクセストークン(PAT)を発行し、
パスワードの代わりに入力してください。
3. 既存のリモートURLをSSHに変更する場合
git remote set-url origin git@github.com:{リポジトリ情報}
おすすめはSSHキー認証です。
まだSSHキーを作成・登録していない場合は、
以下のコマンドで作成し、GitHubに公開鍵を登録してください:ssh-keygen -t ed25519 -C “your_email@example.com”
作成した公開鍵(例:~/.ssh/id_ed25519.pub)をGitHubアカウントに登録します。