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

カテゴリー: Git BASH  閲覧数:298 配信日: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

週間人気ページランキング / 12-2 → 12-8
順位 ページタイトル抜粋 アクセス数
1 大前提 /「Twitter」アカウント /「Twitter Developers」アカウント 2
1 ログイン 2
1 「User is not Authorized」と「Phone number is already in use for too many accounts and cannot be added to another user.」は連動していない | Twitter Developer(Twitter) 2
1 「既存Twitterアプリが使用できる」からと言って「Twitter開発者アカウント」を保持しているとは限らない | Twitter Developer(Twitter) 2
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(Git) 2
2 個人事業主が導入可能な決済系サービス最終選考 | 決済(Webサービスビジネス) 1
2 teratailでは質問しない | プログラミング 1
2 Twitter API | Twitter API (Twitter) 1
2 分かりづらい点 1
2 Windows10で使用できるGitクライアント | GitHub(Git) 1
2 問題発生 / 凍結解除申請 / 問い合わせ 1
2 デザイン カテゴリー 1
2 開発 0 1
2 「Twitterデータ」対応 | Twitter Developer(Twitter) 1
2 Webサービス | ブックマーク 1
2 Twitterで、画像(extended_entities)取得できないツイートがある場合は、tweet_modeパラメータ付与 | Twitter Developer(Twitter) 1
2 Twitter 目次 | Twitter Developer(Twitter) 1
2 「Email sent! We sent you a new copy of the confirmation email.」と表示されているのに、メール受信出来ない | Twitter Developer(Twitter) 1
2 Twitter 電話番号の問題 | Twitter Developer(Twitter) 1
2 問題発生 / 対応 1
2025/12/9 1:02 更新
指定期間人気ページランキング / 2020-5-27 → 2025-12-8
順位 ページタイトル抜粋 アクセス数
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(開発環境) 1072
2 fatal: remote error: is not a valid repository name | Git BASH(開発環境) 749
3 Twitter アカウント管理 | Twitter Developer(Twitter) 622
4 開発 0 608
5 Twitter API | Twitter API (Twitter) 599
6 動画対応 | プログラミング 591
7 「Twitterデータ」対応 | Twitter Developer(Twitter) 567
8 Windows10で使用できるGitクライアント | GitHub(開発環境) 466
9 本 | ブックマーク 452
10 Webサービス | ブックマーク 426
11 マッチングサービス | Webサービスビジネス 404
12 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 370
13 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 328
14 teratailでは質問しない | プログラミング 303
15 技術書籍 | プログラミング 300
16 気になった動画 | ブックマーク 294
17 埋め込みツイート | Twitter Developer(Twitter) 272
18 個人事業主 | Webサービスビジネス 250
19 Twitter 電話番号の問題 | Twitter Developer(Twitter) 235
20 コインチェック株式会社   | Webサービスビジネス 217
2025/12/9 1:02 更新