問題発生 / 意図せずSubModule / エラー原因は、Gitが管理しているレポジトリの重複

カテゴリー: Git BASH  閲覧数:393 配信日:2022-10-20 03:13


問題発生


「hoge」ディレクトリ追加後、「$ git add -A」コマンドを実行したら、「warning: adding embedded git repository: hoge」警告表示されました。
$ git add -A
warning: adding embedded git repository: hoge
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint:   git submodule add <url> hoge
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint:   git rm --cached hoge
hint:
hint: See "git help submodule" for more information.


意図せずSubModule


色々試行錯誤している内に、意図せずSubModuleが作成されてしまいました。
Githubのhogeフォルダに矢印が表示されています。
githubでフォルダに矢印が!やっと解決した話

$ git commit -m "public_html all"
fatal: 'git status --porcelain=2' failed in submodule hoge



エラー原因は、Gitが管理しているレポジトリの重複


新たに配置した「hoge」ディレクトリ内に、別のリポジトリが存在していたことがエラー原因
【Git】エラーの原因と対処法:warning: adding embedded git repository You’ve added another git repository inside your current repository

週間人気ページランキング / 11-27 → 12-3
順位 ページタイトル抜粋 アクセス数
1 開発 0 20
2 ログイン 6
3 「ERROR: Repository not found. fatal: Could not read from remote repository.」と表示された場合は、 | Git BASH(Git) 5
4 ユーザコメント一覧ページ 3
4 ゲストコメント一覧ページ 3
4 カテゴリ一覧 3
5 Fintechの中で私が興味を抱いている機能 2
5 Webサイト制作履歴 | Webサービス開発 2
6 authorize authenticate | Twitter Developer(Twitter) 1
6 統計 カテゴリー 1
6 Q2.About multiple applications 1
6 大前提 / 問題発生 /「Twitter アカウント開設」では認証メールが届くが「Twitter Developersアカウント開設」では認証メールが届かない具体例 1
6 「statuses/user_timeline」気が付いた点 / 一応の目途が付いたためTwitterアカウントの関連スペックを確認 / RTデータ移行するための運用方法を整理 1
6 技術書籍 | プログラミング 1
6 スポーツ 1
6 「Twitter API」は、2023 年 5 月 10 日時点では、SMS認証(電話番号登録)不要でプロジェクト作成できるよう仕様変更されています。 | Twitter API (Twitter) 1
6 分類が必要 / A.お金を直接取り扱うか / B.クレジットカード決済可能か / C.スマホ必要か 1
6 中分類 1
6 Twitter Developer(Twitter) カテゴリー 1
6 マッチングサービス | Webサービスビジネス 1
2026/12/4 5:05 更新
指定期間人気ページランキング / 2020-5-27 → 2026-12-3
順位 ページタイトル抜粋 アクセス数
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(Git) 1092
2 開発 0 901
3 fatal: remote error: is not a valid repository name | Git BASH(Git) 756
4 Twitter アカウント管理 | Twitter Developer(Twitter) 630
5 Twitter API | Twitter API (Twitter) 606
6 動画対応 | プログラミング 600
7 「Twitterデータ」対応 | Twitter Developer(Twitter) 572
8 Windows10で使用できるGitクライアント | GitHub(Git) 472
9 本 | ブックマーク 469
10 Webサービス | ブックマーク 437
11 マッチングサービス | Webサービスビジネス 415
12 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 375
13 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 338
14 技術書籍 | プログラミング 319
15 teratailでは質問しない | プログラミング 314
16 気になった動画 | ブックマーク 303
17 ログイン 291
18 埋め込みツイート | Twitter Developer(Twitter) 279
19 個人事業主 | Webサービスビジネス 259
20 Twitter 電話番号の問題 | Twitter Developer(Twitter) 249
2026/12/4 5:05 更新