「no submodule mapping found in .gitmodules」解決の一例です

誤ってrepoAの中で、 git clone hadoopgit add && commit したの話です。

$ cd repoA

$ git clone github:/abc/hadoop

$ git add .
warning: adding embedded git repository: hadoop
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:   git submodule add <url> hadoop
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:   git rm --cached hadoop
hint: See "git help submodule" for more information.


$ cd hadoop/
$ rm -rf .git/
$ git commit -m "xxx"


fatal: no submodule mapping found in .gitmodules for path 'hadoop'



# ファイルパーミッションにSubmoduleになっているものを探す
$ git ls-files --stage | grep 160000
160000 58e597f4bb5d3f15680a25814bfee5041027b7c9 0   hadoop

# 一旦rmする
$ git rm --cached hadoop
rm 'hadoop'

$ git status

# 追加戻し
$ git add .
$ git commit --amend

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.