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

カテゴリー: Git BASH  閲覧数:353 配信日: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-12 → 8-18
順位 ページタイトル抜粋 アクセス数
1 開発 0 8
2 「Twitter アカウント開設」のために受信可能なメールアドレスと、「Twitter Developersアカウント開設」のために受信可能なメールアドレスは仕様が異なる(と思われる) | Twitter Developer(Twitter) 2
3 ソフトウェア カテゴリー 1
3 Twitter API Oauth / Application-only authentication: Oauth2 (bearer token) / Application-user authentication: Oauth 1a (access token for user context) 1
3 ブログ化サービス / 3,200件以上の自分の過去ツイートを閲覧するためには? / 感想 1
3 未来を感じる 1
3 authorize VS authenticate VS アプリケーションのみの認証 | Twitter Developer(Twitter) 1
3 デザイン カテゴリー 1
3 掲示板 1
3 ゲストコメント一覧ページ 1
3 Git 失敗履歴2。「$ git reset」→ ソースコード削除。※Git BASH 経由で Windows10 から GitHub へ PUSH しようとするも、誤ってソースコードを削除してしまう | Git BASH(Git) 1
3 データ統計 1
3 スポーツ 1
3 12.ローカルリポジトリ(mainブランチ)(の変更)を送信して、リモートリポジトリ(「origin」上の同名ブランチ)へ反映させる / 迷走作業失敗履歴 1
3 Webサービスビジネス カテゴリー 1
3 鉄道 1
3 アップロードされたファイルを定期的に削除する 1
3 イベント 1
3 「インターネット計測とデータ解析 2010」視聴メモ | SFC(プログラミング) 1
3 電話番号認証を新規で行う(SMSメールを受信する)度に、(以前の該当アカウントでは)下記メールを受け取る 1
2026/8/19 5:05 更新
指定期間人気ページランキング / 2020-5-27 → 2026-8-18
順位 ページタイトル抜粋 アクセス数
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(Git) 1083
2 fatal: remote error: is not a valid repository name | Git BASH(Git) 754
3 開発 0 735
4 Twitter アカウント管理 | Twitter Developer(Twitter) 629
5 Twitter API | Twitter API (Twitter) 605
6 動画対応 | プログラミング 598
7 「Twitterデータ」対応 | Twitter Developer(Twitter) 569
8 Windows10で使用できるGitクライアント | GitHub(Git) 471
9 本 | ブックマーク 463
10 Webサービス | ブックマーク 435
11 マッチングサービス | Webサービスビジネス 411
12 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 374
13 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 334
14 技術書籍 | プログラミング 308
14 teratailでは質問しない | プログラミング 308
15 気になった動画 | ブックマーク 300
16 埋め込みツイート | Twitter Developer(Twitter) 278
17 個人事業主 | Webサービスビジネス 256
18 ログイン 252
19 Twitter 電話番号の問題 | Twitter Developer(Twitter) 248
2026/8/19 5:05 更新