0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitHubで別アカウントを使う時にハマった

Posted at

見出しの通りにWindows環境でのGitHubの複数アカウント認証でハマった。仕事用のアカウントに上げてたリポジトリで汎用的に使えそうなやつを個人用に移そうとして、しばらく手間取ったのと、それを調べても一つの情報源で解決しなかったのでここにまとめておく次第。

エラー内容

$ git push -u origin master
remote: Permission to <移行先アカウント>/<リポジトリ名>.git denied to <移行元アカウント>.
fatal: unable to access 'https://github.com/<移行先アカウント>/<リポジトリ名>.git/': The requested URL returned error: 403

git configもしたし、一通り怪しそうなファイルも見たけどどこにも元のアカウント情報は残ってない。似たような事象で検索した結果が以下。

資格情報マネージャー

これまで一度も存在を意識したことがなかった、こいつが認証情報を持っていた。macOSだとキーチェーンみたいなものだろう。

資格情報マネージャーを開いて、_汎用資格情報_に_git:https://github.com_の項目があり、これを削除してgit pushしたら、エラーなく行けた。良かった良かった。

0
2
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?