0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ローカルリポジトリとリモートリポジトリの繋ぎ込み403エラーの解決策

Posted at

ローカルリポジトリとリモートリポジトリの繋ぎ込み時のエラーの解決策🗝️

Gitを使用して、新しく作成したGitHub上のリモートリポジトリへ、mainブランチをpushしようとしたところ、下記のエラーが発生しました。原因と解決策を調べ解決できたのでその流れを記載します。


🔸エラーの内容

git push origin main #main ブランチを push

remote: Permission to rai-code11/new_test.git denied to <gihubのユーザ名>.
fatal: unable to access 'https://github.com/<gihubのユーザ名>/<リポジトリ名>/': The requested URL returned error: 403

原因は以前使用したログイン認証情報がMac内に保存されており、それにより今回作成したのリポジトリにアクセスできないことです。


🗝️解決策

 Macから以前のgithubの認証情報を削除することで解決

📗Macからgithubの認証情報を削除する手順

1.Macのアプリケーションを開きます。
スクリーンショット 2025-06-01 10.39.43.png

2.ユーティリティを開きます。

スクリーンショット 2025-06-01 10.40.18.png

3.キーチェーンアクセスを開きます。
スクリーンショット 2025-06-01 10.41.47.png

4.右上にある検索バーでgithubと検索します。

5.ログイン情報の上で右クリックをして削除して完了です。
スクリーンショット 2025-06-01 10.42.02.png

スクリーンショット 2025-06-01 10.43.03.png

6.再度git push origin mainコマンドを打ち、ログイン情報が求められ繋ぎ込みをして完了です。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?