git clone が「Repository not found」で失敗する(private/認証)
remote: Repository not found は、リポジトリ名が違うか、private リポジトリへのアクセス権・認証が通っていないときに出る。
URL の綴り、認証方式(PAT/SSH)、アカウントの所属を順に確認する。
公開: 更新:
要約
remote: Repository not found. は GitHub が「そのリポジトリは存在しないか、あなたには見えない」と返している状態。
public なら綴り違い、private なら認証・権限不足がほとんど。
private の存在自体を秘匿するため、権限が無くても 404 相当を返す仕様(Troubleshooting cloning errors(新しいタブで開く))。
まず URL を確認し、次に認証が通っているかを見る。
実行例
空の資格情報で GitHub に接続した状態で git ls-remote を実行すると、実在しないリポジトリと実在する private リポジトリはどちらも URL 以外は同じ remote: Repository not found. と Authentication failed の 2 行で失敗し、public の git/git だけが HEAD を返した。
資格情報を渡さず端末のプロンプトも無効にした場合は、ユーザー名を尋ねる段階で could not read Username になって止まっている。
$ git ls-remote https://github.com/camo-maybe/this-repo-does-not-exist-9f3a.git
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/camo-maybe/this-repo-does-not-exist-9f3a.git/'$ git ls-remote https://github.com/camo-maybe/dekinai-com.git
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/camo-maybe/dekinai-com.git/'$ git ls-remote https://github.com/git/git.git | head -1
0f8e75abebff0877cae681a3d5ff31ac47f54220 HEAD$ GIT_TERMINAL_PROMPT=0 git ls-remote https://github.com/camo-maybe/dekinai-com.git
fatal: could not read Username for 'https://github.com': terminal prompts disabled— 2026-09-26 時点の出力
検証環境
- 検証日
- 実行環境
alpine/gitAlpine Linux v3.24- バージョン
- Git 2.54.0
この記事の「実行例」は、上記の環境で実際にコマンドを実行して得られた出力をそのまま掲載しています。 再現手順はリポジトリの検証スクリプトとして管理し、定期的に再実行して出力を更新しています。
よくある原因
- 綴り・オーナー違い: リポジトリ名やユーザー/Organization 名が間違っている、または別アカウント所有でアクセス権が無い。
- 未認証の private: private リポジトリに、ログインしていない・権限の無い資格情報で接続している。
- 失効した PAT: HTTPS で期限切れ・スコープ不足のトークンを使っている(GitHub はパスワード認証を廃止済み)。
- SSH 鍵未登録: 鍵が GitHub に無く、匿名扱いになって「存在しない」ように見える。
解決策
1. URL を確認する
推測でタイプせず、リポジトリページから clone URL をコピペする。
git clone https://github.com/OWNER/REPO.git2. HTTPS は PAT で認証する
パスワード認証は使えないため、Personal Access Token をパスワード欄に入力する(または資格情報ヘルパに保存)。
git remote -v # 現在の URL を確認
git remote set-url origin https://github.com/OWNER/REPO.git3. SSH は鍵と SSO を確認する
鍵を登録し、疎通を確認する。
Organization が SAML SSO 必須なら、その鍵・トークンを Authorize する。
ssh -T git@github.com
# Hi USERNAME! ... と返れば認証成功