LoginSignup
26
19

More than 1 year has passed since last update.

突然GitHubにpushできなくなった。The requested URL returned error: 403の解決方法

Last updated at Posted at 2021-08-14

いつものようにGithubにpushすると...

ターミナルに以下のようなエラーが表示されてしまう。。。
同じ事象で困っている人はいるのではないでしょうか!
本記事では、その原因と解決方法を紹介しております。

ターミナル
% git push origin develop

Username for 'https://github.com': ユーザー名
Password for 'https://ユーザー名@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: unable to access 'https://github.com/ユーザー名/リポジトリ名.git/': The requested URL returned error: 403}

403エラー:アクセス権がない

エラー文にはこのURLを見て下さいと書かれているので参照してみると...

ターミナル
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

内容としては、2021年8月13日からパスワード認証を廃止するというお知らせである。
どうやらGitHubへのアクセス方法が変更されたようだ。
https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

エラーの原因

ローカル環境からGitHubにアクセスする際の情報が以下に変更されたため。

・ユーザー名
・メールアドレス
・パスワード

・ユーザー名
・メールアドレス
・個人アクセストークン

どうやって解決するの?

以下の手順通りに個人トークンを発行し、パスワードの代わりとして設定することでGitHubにアクセスできるようになります。

26
19
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
26
19