LoginSignup
1
0

More than 1 year has passed since last update.

GitHubがパスワード認証の際にエラーが発生したときの対処法

Posted at

症状

いつものようにgitbashでwebアプリのコードをgithubにアップしようと思ってパスワードを入力したところ以下のメッセージが出ました。😲

gitbash
$ git remote add githuborigin https://github.com/ユーザーネーム/リポジトリ名.git
$ git push githuborigin master
Username for 'https://github.com': ユーザー名
Password for 'https://username@github.com': ここでパスワードを入力

#この下からエラー文
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/ユーザーネーム/リポジトリ名.git/'

原因

パスワード認証は2021年8月13日をもって使用できなくなったから

解決法  SSH認証かアクセストークン認証をする

今回は簡単なアクセストークン認証ご紹介します♪

アクセストークンでの認証方法

  1. 以下でアクセストークンを取得する画面へ
     アクセストークン取得
  2. 項目蘭の[repo] にチェックを入れ[Generate new token]をクリック
    3.トークンをコピー !!(ページを離れると再び見ることができなるなるので注意)!
  3. 今まで使っていたパスワードの代わりに使用します

使用例

使用例
$ git remote add githuborigin https://github.com/ユーザーネーム/リポジトリ名.git
$ git push githuborigin master
Username for 'https://github.com': ユーザー名
Password for 'https://username@github.com': ここに取得したアクセストークンを入力

以上です

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0