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

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

週間人気ページランキング / 8-30 → 9-5
順位 ページタイトル抜粋 アクセス数
1 コインチェック株式会社   | Webサービスビジネス 2
2 we are unable to approve your developer application at this time. | Twitter Developer(Twitter) 1
2 Git Bash で異なるディレクトリの指定ディレクトリへ移動する。「$ cd /L/3_開発/git/大阪府」 | Git BASH(Git) 1
2 Twitter API v1.1 / OAuth 1.0A / OAuth 2.0 1
2 Git 確認系コマンド | GitHub(Git) 1
2 「Windows10」へ「gitfor windows VERSION 2.22.0」をインストール | GitHub(Git) 1
2 「既存Twitterアプリが使用できる」からと言って「Twitter開発者アカウント」を保持しているとは限らない | Twitter Developer(Twitter) 1
2 「Twitter Developers」でApp作成 | Twitter Developer(Twitter) 1
2 過去の「0文字引用RT」を期間指定して取得しようとするも、挫折 | Twitter API (Twitter) 1
2 リーディングアプリサービスとなるためには信頼関係など不要。アフィリエイターを使い捨てる戦略が有効 | Webサービスビジネス 1
2 個人事業主が導入可能な決済系サービス2次選考過程第1段階 | 決済(Webサービスビジネス) 1
2 開発 0 1
2 古いコードを処分 | プログラミング 1
2 RTだけ表示するやつ / 2020/3/20時点の結論 / Link 1
2 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 1
2 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(Git) 1
2 旧 Twitter API 分類 / REST APIs / Streaming APIs | Twitter API 旧仕様(Twitter) 1
2 意図せずSubModule(ディレクトリに白い矢印)が作成された場合は、「$ git rm -rf --cached <対象ファイル or path>」後、「$ git add <対象ファイル or path>」 | Git BASH(Git) 1
2 既存Twitterアカウントより電話番号を削除すると、どうなるの? 新規アプリ作成する際、再度電話番号を使用したSMS認証が必要になる | Twitter Developer(Twitter) 1
2025/9/6 1:02 更新
指定期間人気ページランキング / 2020-5-27 → 2025-9-5
順位 ページタイトル抜粋 アクセス数
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(開発環境) 1048
2 fatal: remote error: is not a valid repository name | Git BASH(開発環境) 746
3 Twitter アカウント管理 | Twitter Developer(Twitter) 619
4 Twitter API | Twitter API (Twitter) 596
5 開発 0 593
6 動画対応 | プログラミング 589
7 「Twitterデータ」対応 | Twitter Developer(Twitter) 558
8 Windows10で使用できるGitクライアント | GitHub(開発環境) 455
9 本 | ブックマーク 446
10 Webサービス | ブックマーク 424
11 マッチングサービス | Webサービスビジネス 403
12 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 361
13 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 322
14 teratailでは質問しない | プログラミング 301
15 技術書籍 | プログラミング 300
16 気になった動画 | ブックマーク 292
17 埋め込みツイート | Twitter Developer(Twitter) 271
18 個人事業主 | Webサービスビジネス 250
19 Twitter 電話番号の問題 | Twitter Developer(Twitter) 233
20 コインチェック株式会社   | Webサービスビジネス 208
2025/9/6 1:02 更新