tmegos blog

Web developer

GitHubをhttpsで操作するときにusernameすら聞いてくれなくなった

GitHubでは2021/08/13からgit操作でのIDとパスワードによる認証ができなくなりました https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

Parsonal Access Token(PAT)を準備してfetchしてみると

$ git fetch
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 '' The requested URL returned error: 403

どうして
usernameすら聞いてくれないとは…

どこかに認証情報がキャッシュされていないか探したところ、.netrc に古い認証情報が残っていました

~/.netrc のうち、github.comの項目を削除

対応後、再びusernameを聞いてくれるようになりました

$ git fetch
Username for 'https://github.com': megos
Password for 'https://megos@github.com': # PATを入力する

参考

qiita.com